Subj : Re: How do I use a variable in a command To : Anssi Saari From : Pekka Takala Date : Mon Apr 09 2018 11:32:43 On 23.03.2018 09:49, Anssi Saari wrote: > Thomas writes: > >> On the C64 I have an ML Routine that displays a directory. >> The format for the command is SYS850,"$:*" >> I need to insert a variable into the $ string. So that in a program I >> can display filenames that start with a letter. >> >> For example, I want to display all file names that start with I. so >> >> 10 A$="I":sys850,"$:"+A$+"*" >> >> will not work. >> Does anyone know a way to do this? > > What about putting the whole argument into A$, does that work? So > for example just > > 10 A$="$:I*":sys850,A$ > > But really, in stock C64 basic SYS doesn't take parameters so > I suppose you have something non-stock running? So maybe you can look > into how that works to figure out how to do what you want? > If I needed something like this, I would just check how Print reads its parameters. The comma is easily gone over, but string reading is hard. Another way to accomplish this is that you have the routine, and use a for loop to decode the string. Like this: 10 a$="I":b$="$:"+a$+"*" 20 r=len(b$):poke679,r:forl=1tor:poke679+l,asc(mid$(b$,l,1)):next 30 sys850 Assuming that your routine knows that your string length is at 679 and actual string is from 680. The restriction for area is the length of the area. Of course your string can reside under rom memory or wherever else, if you turn off the roms temporarily before reading the string. This is only a example, there is millions of other ways to accomplish this. --- SoupGate-Win32 v1.05 * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3) .