Qbasicnews.com

Full Version: QUICK mess...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

I've written a program using Random access files but something's wrong with the execution...I keep getting an error message saying 'Identifier cannot include periods'
the program line is this- INPUT "First name";Employee.First I really dont get the problem, I did everything the way the tutorial taught me... I used the Type...Endtype and DIM Employee to it and then opened for RANDOM properly,,, so what's wrong,,, I NEED HELP FASTTT... its for a school project due in a couple of days... PLEASE SOMEONE HELP ME!!!!!
Sad
could you please give some more of your code (and slow down typing)

edit: the only way i could figure out is that you may have put a period in the Type

WRONG:
Code:
TYPE a.a
a AS STRING * 32
END TYPE
RIGHT:
Code:
TYPE aa
a AS STRING * 32
END TYPE

the wrong one would give you the error specified
Are you sure there's no typos with "employee" or "first"? Maybe if you could post the code your using, we could help more....
Quote:could you please give some more of your code (and slow down typing)

edit: the only way i could figure out is that you may have put a period in the Type

WRONG:
Code:
TYPE a.a
a AS STRING * 32
END TYPE
RIGHT:
Code:
TYPE aa
a AS STRING * 32
END TYPE

the wrong one would give you the error specified
Or perhaps his TYPE contains a property with a period, as well. I think (not sure) that you can have a type named a.a.
@Zack: No you cant have a '.' in the type name. But also (just tested) you cant have a period in the property
You'll get that error when you haven't DIMmed the Employee as EmployeeType...

Eg:

Code:
TYPE EmployeeType
  First AS STRING * 10  ' First name
  Last AS STRING * 10  ' Last name
END TYPE

' !! Important!!
DIM Employee AS EmployeeType

LINE INPUT "What is your employee's first name? ", dat$

' We have to make dat$ 10 characters long before it will work for Employee.First
FOR I = LEN(dat$) TO 10
  dat$ = dat$ + " "
NEXT I

' Assign the variable
Employee.First = dat$

Off the top of my head, but should work fine.
er. in that code when i take out the 'DIM' you get type mismatch (obviously =p)
Quote:er. in that code when i take out the 'DIM' you get type mismatch (obviously =p)

Oh, you're talking about the error? Well, that's because I'm not doing INPUT "...", Employee.First, I'm doing INPUT "...", dat$. So you would get the error you say in my code, and not the other one Wink
thats a mighty fine substitute :roll:
... except you don't get the error cos you wouldn't take the DIM out, would you? Wink
Pages: 1 2