| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: How do I use a variable in a command |
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 | FidoUsenet Gateway (3:770/3) SEEN-BY: 57/0 116/102 153/150 250 317/2 3 393/68 633/267 280 640/384 712/620 SEEN-BY: 712/848 770/0 1 3 100 340 772/0 1 210 500 @PATH: 770/3 1 712/848 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.