|
Post by Rod on Apr 23, 2021 18:29:36 GMT
Good, I am much less confused. Since a delimiter is meant to be unique it is no surprise it causes confusion when introduced to the data stream within code. Bit like a rogue , in badly parsed CSV file.
Using two delimiters is a fix, a cleaner solution would be no delimiter at all. Allow all characters and parse nothing. Use the whole string.
There are many ways to store and retrieve string data. It need not be a delimited list.
|
|
|
Post by xxgeek on Apr 24, 2021 6:49:58 GMT
Good, I am much less confused. Since a delimiter is meant to be unique it is no surprise it causes confusion when introduced to the data stream within code. Bit like a rogue , in badly parsed CSV file. Using two delimiters is a fix, a cleaner solution would be no delimiter at all. Allow all characters and parse nothing. Use the whole string. There are many ways to store and retrieve string data. It need not be a delimited list. Yeah Rod, the confusion was my fault. I started this conversation in another thread and when I wasn't getting a response I created a new thread (I was impatient needing some clarity to move on). You were only getting half the story so no wonder you were discombopulated. I'll see if i can figure out a way to salvage most of what I have so far and look into another method, unless I can get this working. The Dictionary code works very well. I'd like to use it, as it suits the purpose to a tee. What I am doing is setting up a page for development of JB code. On that page there is the FastCode generator and JBSearch by cundo using 2 listboxes and a texteditor, along with those i have 4 more listboxes, and 4 more texeditors to save Working Programs, Example code, Commands and Syntax, and Guides. All are edittable by the user(I should say will be). and get saved by Dictionary to 4 separate files. Over time anyone using this will build up a substantial amount of code, most of it good working code. Part of the plan is to have my Project Organizer save all programs that make a tkn file (possibly other code as well). As you know when making the tkn file jbasic.exe automatically debugs the code and doesn't make the tkn file if it hits any errors. If the code passes the debug, it will be saved to the Programs.dat file by P O. A user can copy paste any code they wish into any editor box along with documentation if they so desire. These .dat files can be swapped between users, adding to the reservoir of good working code, and instructions. cundo's JBSearch engine does a good job of finding help on topics, and users can select a bit of advice and save it to a list to have right in front of them as they learn to code JB. Through this forum they can swap .dat files. Different people code different ways, and code for varying reasons, like game coders, data coders, physics etc. The more code to learn from, the easier it gets. Thanks for your time Rod, have a great day.
|
|
|
Post by Enzo on Jun 19, 2021 22:29:33 GMT
No need to confuse, example of problem I'm not sure exists anymore, would error on third line with use of commands
array$(1) = "print"
[loop] input "Type hllo wrld"; input$ array$=array$(1) if left$(word$(input$,1),1) = array$(1) or array$ then'error line would of been here without using SOME character no need to be an capital "A" ... cont
print right$(word$(input$,1),1) end if
goto [loop]
Basically the program would think it would need to send a print command to mainwindow mid program. Nothing more, nothing less, if you can use a JB command has a value in a String$ and it does not error then this was fixed if not, the way around was adding a single character or word infront of command so it would register using a left$word$ type parse instead of a = sign comare to string$ from array$.
|
|
|
Post by Rod on Jun 20, 2021 8:45:31 GMT
The code you post does not compile and it is still not clear what this additional character does. In any event the thread actually discusses the use of a delimiter. The problem was the coded delimiter could not be handled by the parser when it appeared in the code itself. Adding an extra character would not provide a solution.
|
|
|
Post by Enzo on Jun 20, 2021 16:32:41 GMT
The problem was found and noticed by me trying to create a data input form IDE years ago, and adding the extra character DID provide a solution I happened to use a capital "a" as the extra parse getting rid of it, would allow JB to use/store JB commands in string$ memory without erroring, my code has a invalid OR sign for logical reading purposes.
|
|
|
Post by tsh73 on Jun 20, 2021 22:42:48 GMT
So was your problem was - using JB own keywords (like INPUT) to name a variable? (no wonder then)
I don't see any error with your code after getting rid of OR part. With JB 2.0 or 1.1.
|
|
|
Post by Enzo on Jun 20, 2021 23:13:06 GMT
Yes, and I don't believe print caused it? Not sure of vers
Here another example a little more to the point as I feel I owe a better response into explaining my original post
[programstartint]
array$(1)="input" 'JB COMMAND arrayinfo$ = array$(1)
[mainloop] input "test please enter 'input'; ";inputvar$
if inputvar$ = arrayinfo$ then 'again; error would happen here print "Completed." else print "null return" end if
wait
|
|