|
Post by rikky on Dec 17, 2019 22:20:25 GMT 1
Hello. I was under the presumption that if you declare a variable that you don't have to put an empty value in it anymore. like: string$ = "" And mostly this seems true. You can declare a variable globaly, and then print it. It prints nothing, but doesn't give an error. You can test the variable if it is empty IF string$ = "" THEN Without an error also. But you can NOT FOR this_word$ IN string$
PRINT this_word$
NEXT this_word$
It gives an ERROR: signal for SEGMENTATION FAULT received - memory invalid or array out of bounds? Try to compile the program with TRAP LOCAL to find the cause.
demo program: GLOBAL string$
PRINT "string$ : " & string$ IF string$ = "" THEN PRINT "string$ = " & string$
FOR this_word$ IN string$ PRINT this_word$ NEXT this_word$
Rik.
|
|
|
Post by Pjot on Dec 18, 2019 7:48:21 GMT 1
Thanks Rik, Actually, this is the same issue as you have mentioned before. Declaring a string variable globally does not actually assign an empty string to that variable. It gets assigned a NULL, and that does not work for the delimited string engine. The current 3.9.4 beta already contains a fix for this problem. Best regards, Peter
|
|
|
Post by rikky on Dec 18, 2019 8:10:43 GMT 1
Aargh, I see now. I thought I downloaded the newest fossil already, and actually I did. But then I chose to have a 'new' OS again. In my case this is only removing a data layer, for I'm working with Berryboot . I realy thought that the new bacon was in the shared layer, and thus preserved. This is what happens if your memory is not what it is supposed to be. I can learn new languages, but I forget EVERYTHING after a few weeks. That's why I like BaCon so much. It's easyer to remember. But even my own posts in the BaCon forum I forget so to see. I'm realy sorry for this. Rik.
|
|