filebox1.path = dirbrowser1.path

Post

Posted
Rating:
#1 (In Topic #1334)
Regular
theyikes is in the usergroup ‘Regular’
 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
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
theyikes is in the usergroup ‘Regular’
 it's okay, i figured it out, for those who may be following in my footsteps the answer is   FileBox1.Path = DirChooser1.SelectedPath
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
theyikes is in the usergroup ‘Regular’
on a seperete question  I'm trying to create a folder. I can use
mkdir "/home/Auser/Desktop/gambas4"
but i cannot use
Mkdir FileChooser1.SelectedPath "Gambas4"
any tips?
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
thatbruce is in the usergroup ‘Regular’

theyikes said

Mkdir FileChooser1.SelectedPath "Gambas4"

Mkdir FileChooser1.SelectedPath <COLOR color="#FF0000">&/</COLOR> "Gambas4"

Online now: No Back to the top

Post

Posted
Rating:
#5
Regular
theyikes is in the usergroup ‘Regular’
 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
Online now: No Back to the top

Post

Posted
Rating:
#6
Guru
BruceSteers is in the usergroup ‘Guru’
Use Try to catch errors
Error management Gambas wiki

Code (gambas)

  1. Try MkDir FileChooser1.SelectedPath &/ "Gambas4"
  2.   Message.Error(Error.Text & "\n" FileChooser1.SelectedPath &/ "Gambas4")
  3.  

This is a good read for new starters  /cat - Gambas Documentation
Welcome to the wonderful world of gambas :)
Online now: No Back to the top

Post

Posted
Rating:
#7
Avatar
Administrator
gbWilly is in the usergroup ‘unknown’

theyikes said

When i execute my script and i create a folder is there anyway of preventing from crashing if i try to recreate said folder?
An other option:

Code (gambas)

  1. If Not Exist(FileChooser1.SelectedPath &/ "Gambas4")
  2.   Mkdir FileChooser1.SelectedPath &/ "Gambas4"

gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories


… there is always a Catch if things go wrong!
Online now: No Back to the top

Post

Posted
Rating:
#8
Regular
theyikes is in the usergroup ‘Regular’
 hey guys! Both your answers worked. Thanks a million for getting back to me. I really enjoy playing with Gambas. I'm pretty new to programming so i figured Gambas was a good place to start. Cheers again!
Online now: No Back to the top
1 guest and 0 members have just viewed this.