Filerequest Problem on Win

Find quick help here to get you started with Hollywood
Post Reply
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Filerequest Problem on Win

Post by Murmel »

Hi.

I have problems with this code on Windows. This save the new Game.exe

Code: Select all

game$ = FileRequest("Select your Game.exe","")
	If game$ = ""
		;Print("Requester cancelled!")
	Else
		game1$ = FilePart(game$)
		game1$ = LeftStr(game1$,14) ;Beschränkung auf 14 Zeichen sonst überschreibt die Scuibox Icons
		scui.Set("StringBox3", { Value = game1$  }, 0)  ;GAME übergeben
		fSaveGameExe
		info$ = game$
		info$ = AddStr (Info$, " as EXE saved.")
		SystemRequest("Information",info$,"Ok")
	EndIf
Under MorphOS it works fine. On Windows, I get the message "Windows can not find c: \ Program"
The save Path ist C:\Program Files (x86)\ioquake3\ioquake3.exe

Is this a problem with spaces? And what can I do? Thx:)

Bye,

Murmel
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Filerequest Problem on Win

Post by Murmel »

Sorry edit not work ?

Function save
The saved Path is correct

Code: Select all

;---Funktion Game.exe abspeichern
Function fSaveGameExe(msg)
;---Prüfung ob exe auch existiert---
result=Exists(game$)
If result <> 1
     SystemRequest("Information","No Game Executable found","OK")
     Gamefound = 0 ;Exe nicht gefunden
EndIf
;If Gamefound = 0
;        sel = SystemRequest("Information","No Exe Found! Really Write This ?","Yes|No")
;       Switch sel
       

  If Eingabe = 1
    ObjektID = scui.GetIFOID("StringBox3")
    Obj=scui.Get(ObjektID)
    game$=Obj.value
  EndIf
  ;Else
  If StrLen(game$) <= 0
	game$ = "No EXE!"
	game1$ = "No EXE!"
  EndIf
OpenFile(2, "game.txt", #MODE_WRITE)
    WriteLine(2, game$)
CloseFile(2)
Gamefound = 1 ;Annahme Exe stimmt
;---Game.exe einlesen---
OpenFile(2, "game.txt")
    game$ = ReadLine(2)
CloseFile(2)
game1$ = FilePart(game$) ; Name der exe nicht Pfad
game1$ = LeftStr(game1$,14) ;Beschränkung auf 14 Zeichen sonst überschreibt die Scuibox Icons
     ; EndSwitch
     ; Else
;EndIf
EndFunction
amigaoneproductions
Posts: 32
Joined: Mon Feb 15, 2010 4:14 pm
Location: Nottinghamshire, UK
Contact:

Re: Filerequest Problem on Win

Post by amigaoneproductions »

Hi,

It's your file request that is missing the "writemode" option,

Try this :

game$ = FileRequest("Select your Game.exe","",#REQ_SAVEMODE)

We had a similar post about this a while ago, take a look at

viewtopic.php?f=4&t=5#p64

for more info
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Filerequest Problem on Win

Post by Murmel »

Hi.

Thanks for the tip:)
However, the problem remains under winxp 64bit
Murmel
Posts: 31
Joined: Mon Apr 12, 2010 9:03 pm

Re: Filerequest Problem on Win

Post by Murmel »

edit not work ;)

No Windows saves the Path correct with Space

This code reads no spaces

;---Game.exe einlesen---
OpenFile(2, "game.txt")
game$ = ReadLine(2)
CloseFile(2)
game1$ = FilePart(game$) ;Enthält nur den Namen der Game.exe, und nicht den Pfad
game1$ = LeftStr(game1$,14) ;Beschränkung auf 14 Zeichen sonst überschreibt die Scuibox Icons
Post Reply