![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hi guys, it's been a while since i've ben active in the forum, code wise....
I'm stuck in a problem... I'm reading an ini file and have an eror label called "erro", wich gets called if there is any proble accesing the file...But how ca I call the errorlabel upon a condition? This is my code... Yes, I know i'm readding teh file 3 times before i use the data... it's my way of doing things...bare with me on this one.. Code:
Sub LoadINI
ErrorLabel(erro)
FileOpen(c,"LusiGES.ini",cRead)
a=FileRead(c)
a=FileRead(c)
a=FileRead(c)
Nome=StrRemove(a,0,5)
'Here I want to test if the resulting string is equal to a known string (my own name), if not, then should be considered an invalid ini file, and jump to the error label.
If Nome<>"Paulo Sérgio Gomes" Then ' then what???
FileClose(c)
Erro:
Msgbox("Não foi possivel ler" & crlf & "o ficheiro LusiGes.ini","Erro de Leitura.",cMsgBoxOK,cMsgBoxExclamation)
End Sub
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
I tryied that, it errors sayin the the variable erro is used before assigned a value..
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
Sorry EREL, i'm too rusted....
I was typing "go to" instead of goto....it's working now... Just one more "Stupid" question, to exit the sub before the error label gets executed.., I just tipe "exit", right?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
I know it probably woul be a lot worse, mistake wise, but woudn't it be more logical an "ExitSub" keyword?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stupid question: Where is TreeView.dll? | yildi | Questions & Help Needed | 2 | 02-16-2008 04:19 PM |
| More SQL questions | HARRY | Questions & Help Needed | 2 | 01-04-2008 11:15 AM |
| SQL Questions | tcgoh | Questions & Help Needed | 7 | 12-31-2007 10:10 AM |
| Another "Stupid" question!!! | Cableguy | Questions & Help Needed | 2 | 06-28-2007 05:15 PM |
| maybe a stupid question,but... | Cableguy | Questions & Help Needed | 7 | 06-17-2007 11:44 PM |