![]() |
|
|||||||
| 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,
Maybe is because I haven't been using b4ppc for the past 2 weeks or so but, how do I reference a string variable in this case? file1="myfile.txt" file2="second.png" file......... file20="lastfile.doc" for x = 1 to 20 if file exist(???)=false then message the user...... Next x How do I reference the file & x in this case? I've tryed If fileexist(file & x) but it doesn't compute....
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
OK I've got it to work..using an array, as I problably should have done to start of..But at the end of the for next loop i keep getting a " out of boudaries" error...
Here's the entire code... Code:
Sub Globals dim file(6) End Sub Sub App_Start Main.Show CheckFiles SIP(False) End Sub Sub CheckFiles File(0)="Pairs v2.ini" File(1)="1.png" File(2)="2.png" File(3)="3.png" File(4)="4.png" File(5)="5.png" For x = 0 to arraylen(File()) If FileExist(File(x))= true Then MsgBox(File(x)) else Msgbox(file(x) & " is missing") end if Next x End sub EDIT: I found my error...forgot to ad the "-1" in the "for x = 0 to arraylen(file())" line... As i said, This could and was a "stupid" question.... ![]() ![]() BTW: I plan to use these subs to check the integrety of my app, so that if some file is missing, the app will not run at all...Not a piracy protection but more of a "error free" thing...I also plan to generate a log if the app does not start to list the missing file... this way will be easyer to debug.
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing Last edited by Cableguy : 06-15-2007 at 04:55 PM. |
|
||||
|
Quote:
Regards, RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD. Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD. "Defeat never comes to any man until he admits it."Josephus Daniels |
![]() |
| 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 |
| One of my stupid questions.... | Cableguy | Questions & Help Needed | 7 | 01-27-2008 11:26 AM |
| Another "Stupid" question!!! | Cableguy | Questions & Help Needed | 2 | 06-28-2007 05:15 PM |