Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: Shish on August 02, 2002, 07:17:17 AM

Title: Convertion tool
Post by: Shish on August 02, 2002, 07:17:17 AM
Can someone write tool that
converts Sci decoder files
(like script.000) into interpriter
files (like 0.scr).
Or maybe Brian release it???
Title: Re:Convertion tool
Post by: OmerMor on August 02, 2002, 07:44:32 AM
I think you only need to rename them...
Title: Re:Convertion tool
Post by: Shish on August 02, 2002, 09:06:22 AM
Yeah!!!
The smallest sci1 game -
Leisure Suit Larry has 547 files!!!
Rename them al!?!?!?!
I was mistaken...
I meant no conversion tool,
but renaming tool!
Title: Re:Convertion tool
Post by: Pikachu14 on August 02, 2002, 09:53:11 AM
Qbasic. Figure it out yourself.
Title: Re:Convertion tool
Post by: Shish on August 02, 2002, 12:49:20 PM
I haven't programmed in QBasic so long
so i forgot everything i'm wrighting:
shell "ren script.00"+ str$(i) +" "+ str$(i)+".scr"

But it's not working!
I think it's because + command make space
between strings...
Maybe someone can help???
Title: Re:Convertion tool
Post by: Pikachu14 on August 02, 2002, 02:31:18 PM
for i=0 to 517

'These lines add trailing zeros. This is the stupid, but easy way.
if len(str(i))=1 then thenum="00"+str(i)
if len(str(i))=2 then thenum="0"+str(i)
if len(str(i))=3 then thenum=""+str(i)

shell "ren script."+thenum+" "+thenum+".scr"

next i
Title: Re:Convertion tool
Post by: Shish on August 03, 2002, 01:17:08 AM
It's not working, man!
It's because
"blablabla" + str$(1) is not
"blablabla1", but
"blblabla            1"
i don't know why it's happens!!!
I tried it in all versions QB i have - 1.0, 4.0, 4.5
Maybe someone else can figure it out???
Title: Re:Convertion tool
Post by: OmerMor on August 03, 2002, 08:10:20 AM
I don't know QBasic, but I know that in VB you need to use the '&' operator to append strings.
Maybe it'll work for you in Qbasic.
Title: Re:Convertion tool
Post by: Mokalus of Borg on August 05, 2002, 12:10:42 AM
str$(1) will return " 1", for reasons best known to itself. If you want to convert a number to a string, without spaces, you need to use ltrim$(str$(x)).

Mokalus of Borg

PS - I knew all those years programming in QBasic would come in handy some day.
PPS - Of course, I was never a hardcore QB hax0r like some freaks out there, but I made do.
Title: Re:Convertion tool
Post by: df on August 05, 2002, 07:38:04 AM
something like

Code: [Select]

dim i as integer

for i=0 to 999
   shell "ren script." & i & " " & right$("00" & i, 3) & ".scr"
next