Hel converting!

New to FreeBASIC? Post your questions here.
Kenny80
Posts: 21
Joined: Mar 31, 2008 8:02

Hel converting!

Postby Kenny80 » Apr 02, 2008 10:04

I get 3 errors when i try compile my program and can't find solution to them, hopefuly anyone of u can share some light!

error 41: error 21: Type mismatch, found ')' in 'cuString = ((charPos * charPos - charPos) + cuString) % 31 + 1'

Code: Select all

cuString = ((charPos * charPos - charPos) + cuString) % 31 + 1


error 21: Type mismatch in 'sl += InStr(Table, cuString) - 1'

Code: Select all

sl += InStr(Table, cuString) - 1


error 7: Expected ')', found '%' in 'If (i % 6 = 0 And i != 24) Then'

Code: Select all

If (i % 6 = 0 And i != 24) Then
wallyfblu
Posts: 69
Joined: May 24, 2006 10:58
Location: ITALY

Postby wallyfblu » Apr 02, 2008 10:21

Hi Kenny80, for the first two example you must indicate the variable type you are using.

for the last the right form is:

Code: Select all

Dim As Integer i

If i mod 6 = 0 And i <> 24 Then
   
EndIf
Kenny80
Posts: 21
Joined: Mar 31, 2008 8:02

Postby Kenny80 » Apr 02, 2008 10:37

Ah i see, thank you
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Postby KristopherWindsor » Apr 02, 2008 17:21

In cuString = ((charPos * charPos - charPos) + cuString) % 31 + 1, it looks like you confused % with Mod (modulus), and are trying to store a number in a string variable. ;-)

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 3 guests