Hey! Ok I've been using Gambas for about 20 minutes, it's cool! So far I've managed to create folders and files but I'm kind of stuck on this one. I have a filebox and a dirbrowser. I'd like to be able to change the filebox directory to match the Dirbrowser one when i click on the browser. I know it's basic but i kind of need your help. I promise it's the first and last question of the night people!
Regard
The Yikes
filebox1.path = dirbrowser1.path
Re: filebox1.path = dirbrowser1.path
it's okay, i figured it out, for those who may be following in my footsteps the answer is FileBox1.Path = DirChooser1.SelectedPath
Re: filebox1.path = dirbrowser1.path
on a seperete question I'm trying to create a folder. I can use
but i cannot usemkdir "/home/Auser/Desktop/gambas4"
any tips?Mkdir FileChooser1.SelectedPath "Gambas4"
Re: filebox1.path = dirbrowser1.path
Thank you The Bruce! Love the name!!! I have one more quick question. It has to do with error handling. When i execute my script and i create a folder is there anyway of preventing from crashing if i try to recreate said folder? Please excuse the newbie questions but I'm only a little bit experienced in visual basic.
Regards:
TheYikes
Regards:
TheYikes
- BruceSteers
- Posts: 1831
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: filebox1.path = dirbrowser1.path
Use Try to catch errors
Error management Gambas wiki
This is a good read for new starters https://gambaswiki.org/wiki/cat
Welcome to the wonderful world of gambas
Error management Gambas wiki
Try MkDir FileChooser1.SelectedPath &/ "Gambas4"
If Error Then
Message.Error(Error.Text & "\n" FileChooser1.SelectedPath &/ "Gambas4")
Endif
This is a good read for new starters https://gambaswiki.org/wiki/cat
Welcome to the wonderful world of gambas
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: filebox1.path = dirbrowser1.path
An other option:
If Not Exist(FileChooser1.SelectedPath &/ "Gambas4")
Mkdir FileChooser1.SelectedPath &/ "Gambas4"
Endif
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer
- Gambas3 Debian repository
... there is always a Catch if things go wrong!
- Dutch translation for Gambas3
- Gambas wiki content contributer
- Gambas3 Debian repository
... there is always a Catch if things go wrong!