Back to forum list… Back to How Do I?...

STRINGLIKE CHARLIST (2 replies and 1 comment)

wmbtaylor1
4 years ago
wmbtaylor1 4 years ago

I am reading data from an XML file in order to create orders in Sage 300 and I have a profile ID that I need to compare against a range of characters.  If the profile ID is 1,3,5,7,12,14,20,22,26,27 then the value returned should be S otherwise it should be M.

 

I tried STRINGLIKE with a CHARLIST similar to this to start with:

IIF (StringLike(%PktProfileID) ,[1357]),"S","M")

and I get the following error: Line=1;Pos=36; Function [[1357]] is invalid.

If I put quotations around the 1357 I get the false part even though it should be true.

So how do I get this to compare a field to multiple values and return true if it is one of those values or false if not?

 

 

 

 

Support
4 years ago
Support 4 years ago

wmb, StringLike doesn't work like this.

Below is an expression which will do the job (there is definitely room for improvement here.

 

Dim Vals
Dim l
Dim Result

Result = False
Vals = Split("1,3,5,7,12,14,20,22,26,27", ",")

For l = 0 to Ubound(Vals)
  If Vals(l) = %PktProfileID Then
    Result = True
  End If
Next

Result

wmbtaylor1
4 years ago

Awesome - thank you so much.. Guess I need to learn more VB Scripting.

wmbtaylor1
4 years ago
wmbtaylor1 4 years ago

What a great support forum - always helpful.

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close