Re: If/then and sequences...
- Posted by Dan B Moyer <DANMOYER at PRODIGY.NET> Aug 28, 2000
- 453 views
I just had a similar problem, so here's a variation on the previous solutions: if your sequence has or might have more than one item in it, and you want to test for something specific there, you can use: if find(1,KeyPressed) then -- pressed <esc> key ("1") (where "KeyPressed" is a sequence (using keyread.e) which may contain scancodes of multiple simultaneous keypresses). 'course, now that I've said that, I've just realized (from reading the manual!), that that only works if the FIRST item in the sequence is the match (because it returns the *position* of the match, which is taken as "true" by the "if" when it is the first position), so I have to go back & fix that! But it's potentially useful anyway. Dan Moyer ----- Original Message ----- From: "LEVIATHAN" <leviathan at USWEST.NET> To: <EUPHORIA at LISTSERV.MUOHIO.EDU> Sent: Monday, August 28, 2000 9:33 AM Subject: If/then and sequences... > Heya all! > > Alright, i've got a slight problem... > > I've got a sequence. An object even. its called buffer. > > I've got to compare a object against another sequence (if buffer[1] = > "file://ammo" then ...) > > However, when I go and run it, it pukes like so: > > "true/false condition must be an ATOM". > > Obviously my object i'm comparing against is a sequence, and the > object i'm using is definatly not a sequence. > > So, how would I get around this? > > TIA, > > --"LEVIATHAN"