on 09-27-2017 10:04 AM
Hello...
I have this string where is parsing mark ' | '
F1E|I21|R|4|30|50|180|35|BG340SR|S10|D11|T10|1P|PVC|PZS-Z25|HS|/|F11|R20|K7035|T7035|/|SNAL|/,|/,/|TOB,S|H,2|/|VZKT|VZKT|SD|
this string elements I need to insert into Array, so I created Formula:
Global StringVar Array myString;
Redim myString [32];
myString:= Split({Command.Parameter},'|');
but now I do not know how can I get n-element/index from the Array
Thank You for any hint
Try
WhilePrintingRecords ;
Shared NumberVar Qty := Sum({Command.Quantity},{Command.Parameter});
Global StringVar Array myString;
Redim myString [32];
myString:= Split({Command.Parameter},'|');
If UBound(myString)>=4
Then Tonumber(myString[4]) * Qty
Or
WhilePrintingRecords ;
Shared NumberVar Qty := Sum({Command.Quantity},{Command.Parameter});
Global StringVar Array myString;
Redim myString [32];
myString:= Split({Command.Parameter},'|');
Global Numbervar Amt:=0;
If UBound(myString)>=4
Then Amt:= Tonumber(myString[4]);
Amt* Qty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how it will be in case when the element will not be Number, but string?
in such case will not be possible use UBound
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just use it as you have
If UBound(myString)>=4
Then myString[4] * yourfield or formula
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This I already tried:
WhilePrintingRecords ;
Shared NumberVar Qty := Sum({Command.Quantity},{Command.Parameter});
Global StringVar Array myString;
Redim myString [32];
myString:= Split({Command.Parameter},'|');
If UBound(myString)>=4
Then myString[4] * Qty
but it returns:
'A number, or currency amount is required here.'
strange, because UBound returns Number and also the variable Qty is datatype Number.
I also tried this:
If UBound(myString)>=4
Then myString[4]
it returns correct value/element, but I need somehow pass the value into variable for next use (multiplication)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Global StringVar Array myString;
myString[n];
Ian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.