|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
hey - im new. any pascal experts here?
err... ok, i've got a variable (integer) which i need to check to see if it's blank or if it isn't (i don't know what the value will be) who new something so simple could be so hard to do? i've tried loads of combinations like: if var1 = nil if var1 not = nil if var1 <> nil Help! assignment has to be in by Friday. Thanks. |
|
#2
|
||||
|
||||
|
It's been a while but isn't Nil just for pointers? I believe an integer would be zero if no value was assigned to it.
__________________
medialint.com "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#3
|
|||
|
|||
|
i have no idea. i dont know what a pointer is. and no its not 0 it comes up with a random value each time.
|
|
#4
|
|||
|
|||
|
In Pascal, surely, you have to define a variable in order for it to work. You know this, I assume.
Initialising the variable is another matter - giving it a value. Now, logically, it can be deduced that there shouldn't be a problem here - if it's initialised, then you know what the value is. Because you've initialised it. If you haven't initialised it, then you can't reference it, and test it for 'blankness', because the program doesn't know what this value actually means. I know it doesn't really answer your question, but does it help? ![]() |
|
#5
|
|||
|
|||
|
it does help thanks. the problem's solved now
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Turbo Pascal |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|