Problems with ReplaceString
Posted: Sun Apr 11, 2004 9:43 am
Hi,
Ive got some Problems with the command replaceString.
Ive got one .con file (its like .txt) where i want to replace the Y Value.
XYZ is set each time in the lines Object.absolutePosition
My problem is, that i dont know how to set the parameters for the command ReplaceString.
You see, that each times "Object.absolutePosition X/Y/Z" not has always the same Y value. So how can i write the command line ?
i really dont know how to fix that , its urgent 
thx
Ive got some Problems with the command replaceString.
Ive got one .con file (its like .txt) where i want to replace the Y Value.
XYZ is set each time in the lines Object.absolutePosition
Code: Select all
rem *** ***
rem
Object.create asteroid
Object.absolutePosition 1024/100/1024
Object.Rotation 243.611/0/0
rem
rem *** ***
rem
Object.create spacerock1
Object.absolutePosition 1241.91/100/1230.2
Object.Rotation 280.8/0/0
rem
rem *** ***
rem
Object.create spacerock4
Object.absolutePosition 1293.92/100/892.582
Object.Rotation 283.942/0/0
rem
rem *** ***
rem
Object.create asteroid
Object.absolutePosition 739.968/141.657/1121.84
Object.Rotation 243.182/0/0
rem
rem *** ***
rem
Object.create asteroid
Object.absolutePosition 805.999/100/814.846
Object.Rotation 292.028/0/0
rem
rem *** ***
rem
Object.create asteroid
Object.absolutePosition 934.951/100/1353.39
Object.Rotation 120.586/0/0
You see, that each times "Object.absolutePosition X/Y/Z" not has always the same Y value. So how can i write the command line ?
Code: Select all
If ReadFile(1, (file$)) ; file$ is the openfilerequester variable
ReplaceString("Object.absolutePosition 1024/100/1024", StringY$, "100" ,1 ,1)
CloseFile(1)
EndIf

thx