Re: Stupid Newbie-sounding question.
- Posted by Michelle <michellerogers at bellsouth.net> May 29, 2004
- 559 views
irv mullins wrote: > > > Michelle wrote: > > > but the problem with that is that it prints "John" as a string of the ascii > > codes, > > instead of an easily editable "John".. > > if i add if sequence() it counts "John" as a sequence, just like the > > sequence of > > flags.. > > so my question is... > > how i can (within a loop) tell it to evaluate whether to puts or print? > > > > bah..told you it was a stupid newbie question > > > > Michelle Rogers > > > > Not stupid at all. > What the Eu docs call "flexible", I call a design flaw. > Euphoria cannot tell the difference between "John" and {74,111,104,110} > where the latter might be a series of integers or flags or whatever. > > The easy way is to not try to write a universal "print" function which > has to somehow detect how things are supposed to be printed, > but just use printf(.. with the appropriate params to print the entire > sequence at one time. Use \n as appropriate to break it up into lines. > > If your flags are always either 0 or 1, (which aren't printable characters), > you might look for 0 or 1 in every sequence, and if found, consider this to > be a sequence of flags, otherwise print as a string. > > Irv. > bah...well..i will be (probably forever) adding variables to the sequence...and no...all of the sequences will not be "flags" that may be 0 or 1.. As a matter of fact, some sequences may be sequences of text... I was trying to make it so that I never had to change the read/write procedures, even though I would be adding variables on... You seem to be saying that it may be impossible to do this? That I may have to manually read/write every line, instead of making a loop? So, that means that each time I add a new variable to the sequence, I have to also go add it to the read/write procedures...bah..was trying to get around that. hmm..*thinking "out loud"*...this isn't the ideal way to do it..but maybe I could assign a fourth parameter to each "variable type" which is a 0 or a 1 to tell if the variable should be holding a string or just plain text...well..or even a 2 for atoms, I guess...although that I can check for