Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Italian Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Variabili Pubbliche

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-12-2012, 04:58 PM
Knows the basics
 
Join Date: Jan 2012
Posts: 79
Default Variabili Pubbliche

Rieccomi appena presentato e gia' disturbo
Sto giocando un po per vedere come funziona la struttura di Basic4 e gia' mi sono scontrato con un problemino.
Come si dichiarano le variabili pubbliche ?
L'ho dichiarata nella Main in

Sub Process_Globals
dim v_path As String
v_path="pippo"
End Sub

dal Main lancio una subrutine presente in un CodModulo chiamata credoDb

Sub CreoDB
Msgbox (v_path)
End Sub

Mi ritorna un errore di non dichiarazione variabilie
Error description: Undeclared variable 'v_path' is used before it was assigned any value.
Occurred on line: 22
Msgbox (v_path)
Dove canno ???
Ciao a tutti e garzie in anticipo
Reply With Quote
  #2 (permalink)  
Old 01-12-2012, 05:04 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Fully, Switzerland
Posts: 4,463
Awards Showcase
Forum Contributer Beta Tester Competition Winner 
Total Awards: 3
Default

You must use:
Code:
Msgbox (Main.v_path)
To access a variable in another module than the one where it was defined in you must add the module name as a prefix.

Ciao.
__________________
Klaus
Switzerland

Beginner's Guide / User's Guide
Reply With Quote
  #3 (permalink)  
Old 01-12-2012, 05:25 PM
Knows the basics
 
Join Date: Jan 2012
Posts: 79
Default

Grazie Klaus
non ci avevo pensato
Reply With Quote
  #4 (permalink)  
Old 01-12-2012, 06:19 PM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 977
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Ciao maxware,

e benvenuto in questo forum.

Come ha già scritto Klaus, le variabili pubbliche che sono dichiarate nella Main li devi chiamare con Main.blabla. Se invece sono in Code-Modul li chiami CodModulo.blabla.

Ti auguro un buon diveritmento con Basic4Andorid.

PS. non esitare a porre domande, natualmente ti consiglio prima die studiare on poco la Guida.

Ciao,
Filippo
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
Reply With Quote
  #5 (permalink)  
Old 01-12-2012, 06:36 PM
Knows the basics
 
Join Date: Jan 2012
Posts: 79
Default

Ciao Filippo
Putroppo il mio inglese e' pessimo per non dire nullo ( ti dico solo che uso spessissimo il traduttore di google ). La soluzione era ovvia ma non so perche' mi ero intestardito a cercate una dichiarazione del tipo Public o Global
Ti ringrazio e a presto nel forum
Reply With Quote
  #6 (permalink)  
Old 01-13-2012, 07:10 AM
Filippo's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Location: Schwäb. Gmünd, Germany
Posts: 977
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Putroppo il mio inglese e' pessimo per non dire nullo ( ti dico solo che uso spessissimo il traduttore di google ).
Non ti preocupare, il mio è lo stesso.
__________________
PPC: MDA Pro, 2GB SD
Device: HTC Desire , Android 2.2
______________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 11:35 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0