Page 1 of 1

Fold Basic Routine, Limit on string length?

Posted: Sun Mar 11, 2012 4:05 am
by roy
Hi Everyone,
I've had to implement Base64 decoding in DS Basic.
In short every 4 characters represent 3 characters,
so I used the Fold function to create sets of 4 characters to work with.
In one case where I convert up to 7k+ characters the job hangs after 50 rows.
10 rows run ok.
Does anyone know if the Fold function has limits or perhaps the Basic proccess reaches a certain limit?
I'm reading from a file and writing to a file
taking 3 columns:
1. @INROWNUM
2. Len(Data)
3. Ereplace(Base64Decode(Data[1,10000]), Char(13):Char(10), " ", 0 , 0)
Any Ideas would be welcome ...

Posted: Sun Mar 11, 2012 7:31 am
by chulett
No clue but if you suspect the issue lies with the Fold function, seems to me you could replace it with substring rather easily.

Posted: Sun Mar 11, 2012 1:06 pm
by qt_ky
Have you tried the FoldDP() function for NLS?

If that doesn't help, can you provide enough detail, with before/after example, to recreate the problem?

Posted: Mon Mar 12, 2012 3:05 am
by roy
The source data is in Base64 format!
Therefore it has no NLS characters in it!
the output data after coversion is another thing!
This is the whole idea of Base64; to keep data managable for DB or movement via data protocols while nutralizing the whole NLS issues.

Posted: Mon Mar 12, 2012 6:00 am
by roy
Wel I got the Fold out but still no change :cry:
Guess this wraps the thread...
I did get to a limit on testing the input string via the routine test option and hit the old 8192 string length limit notification, actual was 8180 anf actual length with no data problems was around 8144 characters
IHTH (I Hope This Helps) ...

Re: Fold Basic Routine, Limit on string length?

Posted: Mon Mar 12, 2012 7:39 pm
by qt_ky
NLS was mentioned in the original post, so I had to ask.

Is your job still hanging, or is it able to process around 8144 characters at a time, no problem?

Re: Fold Basic Routine, Limit on string length?

Posted: Sun Mar 25, 2012 1:20 am
by roy
qt_ky wrote:NLS was mentioned in the original post, so I had to ask.

Is your job still hanging, or is it able to process around 8144 characters at a time, no problem?
The 8144 characte limit was experianced in the routine test environment,
the actual data tested had less then 8,000 charaters.

I ended up keeping the regular ascii values and manually converting the NLS values I got to unicode ones that my computer could handle and transformed everythig else to spaces.
This means I might loose some info,but in order to support anything else I need exact instructions on how to transform givven input.

Posted: Sun Mar 25, 2012 7:19 am
by chulett
So Roy, is this Resolved or Worked Around or are you still futzing with this? :wink: