Requestfile - Default Filenamen/Ordner

Übersicht BlitzBasic BlitzPlus

Neue Antwort erstellen

ozzi789

Betreff: Requestfile - Default Filenamen/Ordner

BeitragDo, Jul 15, 2010 12:24
Antworten mit Zitat
Benutzer-Profile anzeigen
Bei Requestfile soll man ja einen default Filenamen oder Directory abgeben können.
Der Filename klappt, mit dem Ordner gehts nicht.


Ideen?
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5

ozzi789

BeitragDo, Jul 15, 2010 12:34
Antworten mit Zitat
Benutzer-Profile anzeigen
Entschuldigt den Doppelpost aber
dank http://blitzbasic.com/Communit...920#581503 konnte ich einen Workaround nehmen


spfad$=CurrentDir$()+"pictures\File Auswählen"
makefdn(RequestFile("Bild auswählen","*",0,spfad$))

so navigiert es zum pfad, bei Filename steht jetzt einfach "File Auswählen" nicht weiter schlimm, aber ein doofer Bug.
Wenn ich nur ...\pictures\ mache passiert nichts.


Sonst jemand ne Idee wie das richtig geht?
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5

Xaymar

ehemals "Cgamer"

BeitragDo, Jul 15, 2010 13:31
Antworten mit Zitat
Benutzer-Profile anzeigen
So: http://msdn.microsoft.com/en-u...85%29.aspx
Zitat:
lpstrInitialDir
LPCTSTR

The initial directory. The algorithm for selecting the initial directory varies on different platforms.

Windows 7:

1. If lpstrInitialDir has the same value as was passed the first time the application used an Open or Save As dialog box, the path most recently selected by the user is used as the initial directory.
2. Otherwise, if lpstrFile contains a path, that path is the initial directory.
3. Otherwise, if lpstrInitialDir is not NULL, it specifies the initial directory.
4. If lpstrInitialDir is NULL and the current directory contains any files of the specified filter types, the initial directory is the current directory.
5. Otherwise, the initial directory is the personal files directory of the current user.
6. Otherwise, the initial directory is the Desktop folder.

Windows 2000/XP/Vista:

1. If lpstrFile contains a path, that path is the initial directory.
2. Otherwise, lpstrInitialDir specifies the initial directory.
3. Otherwise, if the application has used an Open or Save As dialog box in the past, the path most recently used is selected as the initial directory. However, if an application is not run for a long time, its saved selected path is discarded.
4. If lpstrInitialDir is NULL and the current directory contains any files of the specified filter types, the initial directory is the current directory.
5. Otherwise, the initial directory is the personal files directory of the current user.
6. Otherwise, the initial directory is the Desktop folder.


Die regeln musste beim Pfadangeben beachten. d.h.
BlitzBasic: [AUSKLAPPEN]
ChangeDir $DerOrdner
File$ = RequestFile($DerTitel, $DieErweiterungen, 0, $EinDateiname)

sollte das machen.

ozzi789

BeitragDo, Jul 15, 2010 14:03
Antworten mit Zitat
Benutzer-Profile anzeigen
Funktioniert leider nicht.
Keine Ahnung wieso.
Trotzdem danke! Smile
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5

Xaymar

ehemals "Cgamer"

BeitragDo, Jul 15, 2010 14:05
Antworten mit Zitat
Benutzer-Profile anzeigen
oh mann...
BlitzBasic: [AUSKLAPPEN]
ChangeDir "D:/Ordner/"
File$ = RequestFile("Titel","*",0,"")

Funktioniert einwandfrei. Ich hatte eigentlich nicht vor zweimal antworten zu müssen, nur damit man versteht wie Blitz das handhabt

Edit: Dann ist eindeutig dein System beschädigt. Ich habe das mit Windows XP, Vista und 7 getestet und es geht einwandfrei. Edit2: Nutzt ihr 64bit?
  • Zuletzt bearbeitet von Xaymar am Fr, Jul 16, 2010 13:30, insgesamt 2-mal bearbeitet

ozzi789

BeitragDo, Jul 15, 2010 15:01
Antworten mit Zitat
Benutzer-Profile anzeigen
oh mann du!
hab ich schon ausprobiert, unter vista (hier auf diesem Personalkomputer) scheint das nicht zu gehen, darum überhaupt dieser Beitrag.
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5

blackgecko

BeitragDo, Jul 15, 2010 23:54
Antworten mit Zitat
Benutzer-Profile anzeigen
Bei mir geht Xaymars Lösung auch nicht, System steht in der Signatur.
[EDIT]Nein, 32 bit[/EDIT]

Aber:
Ich hab mal einfach versucht, den Ordner bei defaultname einzugeben, und bei mir funktionierts:
BlitzBasic: [AUSKLAPPEN]
pfad$ = "C:\Users\"
defname$ = "biespeil"
file$ = RequestFile("Titel","*",0,pfad$+defname$)

Es wird zu pfad$ navigiert und defname$ ist das was als Beispielname angegeben wird.
Zu beachten ist, das dieser default name vorhanden sein muss. Wenn man stattdessen
BlitzBasic: [AUSKLAPPEN]
file$ = RequestFile("Titel","*",0,"C:\Users")
macht, wird zu C:\ navigiert und 'Users' ist der Beispielname.
Bei
BlitzBasic: [AUSKLAPPEN]
file$ = RequestFile("Titel","*",0,"C:\Users\")
wird der RequestFile-Befehl sogar einfach nicht ausgeführt. Surprised
So long and thanks for all the fish.
Fedora 17 | Windows 7 || BlitzPlus | BlitzMax
Rechtschreibflame GO!!! Deppenapostroph | SeidSeit | Deppenakzent | DassDas | Deppenleerzeichen | TodTot | enzigste.info - Ja, ich sammel die.
  • Zuletzt bearbeitet von blackgecko am Sa, Jul 17, 2010 14:09, insgesamt 2-mal bearbeitet

ozzi789

BeitragFr, Jul 16, 2010 8:40
Antworten mit Zitat
Benutzer-Profile anzeigen
trolo mein computer ist beschädigt Sad
ne kann ich mir nicht erklären, bin aber froh das ich nicht der einzige bin, werds nacher mal auf meiner VM testen.


@blackgecko
jo so hab ich es jetzt auch, danke! Smile
0x2B || ! 0x2B
C# | C++13 | Java 7 | PHP 5

Neue Antwort erstellen


Übersicht BlitzBasic BlitzPlus

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group