General area when it fits no where else

Moderator: Mmiscool

User avatar
By Electroguard
#58290 Yes, most things can be done with the existing string commands.

Listen, you are the Parsing Maestro, so here's a Parsing Puzzle for you... and for any oldies who remember the DOS days.

Click Start, run CMD, then type COPY /? at the dos command line prompt.

Notice that everything inside of square brackets is optional, and only SOURCE is obligatory. Option switches can be specified anywhere on the command line, can have multiple spaces between them or, even be directly concatenated without any space delimiter between them - eg: copy /x/?), which won't recognise the non-existing /x switch but it does recognise the /? help.

So bearing in mind that the DOS command-line string and it's options were developed for use on skinny RAM before the scourge of Windows obesity, and yet almost every little dos utility could parse out command-line info, how did the 'Ancients' manage to parse out an indeterminate number of mixed commands and option 'switches' with such efficiency?

Cos I'm having a devil of a job trying to do it cleanly and efficiently even with the modern string conveniences of Esp_Basic.

I'm not asking out of nostalgia - I'm trying to get nodes to efficiently send or receive serial and/or udp instructions plus optional additional parameters and behaviour switches. I've got the required functionality but not the efficiency, cos parsing decode time makes it a bit like communicating with Mars.
Does anyone know the algorithm secrets of the Ancients?
User avatar
By tcpipchip
#58324
Mmiscool wrote:I am uploading a new build now that includes a trim function.

Code: Select allbla = "   hello world    "
print trim(bla)



Mmiscool, can you explain us step by step how did you make that update ? Or, wich is the step to create a new comands (passing and receiving parameters) ?