![]() |
|
|||||||
| 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.
I want to know whether a single character string is also a number, e.g. can it be compared to a number, or is there an EVAL function to convert it to a number? I am getting FormatException errors....... thnx Marc |
|
||||
|
Hi,
If you are sure of the variable beeing compatible, usually format exception error are caused by missing or , or ;...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
I frequently experience the format exception error when I call up properties of controls with the wrong arguments, particularly when using the Control command to reference to a control.
You should be given a step number and from there it shouldn't be too difficult to determine what is wrong. Can you just post the section of code that errors? 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 |
|
|||
|
OK, guys, here is the code. It is a program for logistic regression taken (with permission from the author) at http://www.statpages.org/logistic.html (source code). Disregard the stringsigns ($). I know they are not necessary but I am translating from an older basic for PSION code which I made a few years ago.....
just run the program and it errors with a formatexception. I assume the error in is this part: IF ChkbxGrouped.Checked = TRUE then 'for zeros d = SubString(v,0,StrIndexOf(v,",",0)) 'what is value left of comma for zeros IF d > MaxX then MaxX = d 'set MaxX IF d < MinX then MinX = d 'set MinX Y0 (i) = d sY0 = sY0+d v = SubString(v,StrIndexOf(v,",",0)+1,1) 'reset dd$, right of comma d = SubString(v,0,StrIndexOf(v,",",0)) 'what is value left of comma for zeros 'for ones 'what is value left for ones Y1(i) = d sY1 = sY1+d ELSE IF IsNumber(v) then Select v Case 0 Y0(i) = 1 sY0 = sY0+1 Case 1 Y1(i) = 1 sY1 = sY1+1 End Select END IF END IF sC = sC+(Y0(i)+Y1(i)) END IF '// end check if string <> empty thnx for the trouble...... Marc |
|
||||
|
Hi,
I took a quick look at your code. You can,t make arithmetic operations without numbers. xsd(j), xM(j), sC does not contain numbers (empty) when the first error occurs, at line 156. Try to give them initial values and watch them as they change (MsgBox-ing them is a way, or put their values in a textbox) Check all your source. I thing there are more errors like this one. regards |
|
|||
|
I think the problem lies in
Par(0) = LN(sY1/sY0) a few lines above that sY0 doesnt take the value I want and remains zero thus dividing by zero... then I get an error in the line vv = vv + Par(j) * X(i*(nR+1)+j) saying "input string was not in correct format. I wonder why sY0 doesnt take values because that should be the case with the initial data. |
![]() |
| 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 |
| Character encoding / code pages | TWELVE | Questions & Help Needed | 10 | 05-29-2008 04:17 PM |
| ascii character problem | Gale Johnson | Questions & Help Needed | 1 | 05-28-2008 04:59 PM |
| Pick up the single column single row value to a textbox. | mozaharul | Questions & Help Needed | 4 | 05-07-2008 06:24 AM |
| How to convert Hex values in file to number or string | HARRY | Questions & Help Needed | 2 | 02-20-2008 05:04 PM |
| possible to use a character to break off lines of code? | Stellaferox | Questions & Help Needed | 2 | 02-11-2008 10:41 PM |