QB64 Phoenix Edition
Commas in string variable? - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: Commas in string variable? (/showthread.php?tid=867)



Commas in string variable? - bert22306 - 09-07-2022

This might be one of those things that "everyone knows," but I missed the memo. Is there any way to input a string variable which includes commas?

For example, in NMEA 0183 "sentences," all field delimiters are commas. Of course, one option is to change all commas to something else, like semicolons or just spaces. Which I have done, and then afterwards replaced that delimiter with a proper comma.

Is there any way I could input the actual NMEA string as one variable, then in the next step split out each character? I didn't see anything about this limitation in the wiki.

Here is an example of a NMEA 0183 GLL sentence, from a GPS receiver (identified by GP), which provides geo position, UTC time, and "mode," always in ASCII:

$GPGLL,3953.88008971,N,10506.75318910,W,034138.00,A,D*7A

The last two characters, after the * character, are the XOR-based checksum, as two hex characters.


RE: Commas in string variable? - SMcNeill - 09-08-2022

LINE INPUT var$


RE: Commas in string variable? - bert22306 - 09-08-2022

Well, sumbich, and it works fine too. Thanks again, Steve!


RE: Commas in string variable? - Pete - 09-08-2022

Did you hear the one about the dog that swallowed the shoe laces? It had strings in colon.

LINE INPUT Pete$


RE: Commas in string variable? - bert22306 - 09-09-2022

(09-08-2022, 11:38 AM)Pete Wrote: Did you hear the one about the dog that swallowed the shoe laces? It had strings in colon.

Did you hear the one about the python who swallowed that dog? It resulted in a string in a nested loop:

https://pynative.com/python-nested-loops/

Amazing what we learn on this site.