LB Booster
« Help needed with "..\" »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:50am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Help needed with "..\"  (Read 324 times)
SarmedNafi
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 93
xx Help needed with "..\"
« Thread started on: Jun 12th, 2015, 08:04am »

Dear Richard,

Help please,
In the following code:

Code:

[new] 'Creates a new data base
    'create a One level up directory called Blue_Mountain_Accounts 
    result = mkdir( "..\Blue_Mountain_Accounts\")   '...up level Dir works under LBB and LB
    filedialog "Choose A Place To Save A New DataBase ",_
     "..\Blue_Mountain_Accounts\*.dta", pathdbname$  '...up level Dir not work under LBB but works under LB
    if pathdbname$ = "" then Goto wait
wait

 


The up level directory works with "mkdir" under both LBB and LB
But it dose not work under LBB with file dialog.
How could I solve this problem?

Regards
Sarmed
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Help needed with "..\"
« Reply #1 on: Jun 12th, 2015, 10:08am »

on Jun 12th, 2015, 08:04am, SarmedNafi wrote:
How could I solve this problem?

I'm not sure that this 'problem' is the fault of LBB. In recent versions of Windows Microsoft has changed the rules governing which directory is initially displayed in a file dialog. Look at this MSDN page and read the section entitled lpstrInitialDir:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms646839.aspx

Now scroll down to the Community Additions section of the page and read the first comment, which begins "This is ridiculous"!

This is the only straightforward workaround I can offer:

Code:
    result = mkdir( "..\Blue_Mountain_Accounts\")
    template$ = space$(_MAX_PATH)
    calldll #kernel32, "GetFullPathNameA", _
      "..\Blue_Mountain_Accounts\*.dta" as ptr, _MAX_PATH as long, _
      template$ as ptr, _NULL as long, ret as long 
    filedialog "Choose A Place To Save A New DataBase ",_
      template$, pathdbname$
    wait 

Richard.
User IP Logged

SarmedNafi
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 93
xx Re: Help needed with "..\"
« Reply #2 on: Jun 12th, 2015, 10:47am »

Thank you Richard,

Your help is great, you know? I was going to write a function to do that.
Because in what I am doing I got a "One ticket to the moon". I got no way to go back!
However this must be added to LBB help file, actually this con forum is an extension to LBB help file.

All the best to you,
Sarmed
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls