Posts: 3,279
Threads: 170
Joined: Nov 2003
That reminds me of an old coder's phrase...
"Real coders don't comment. If it was hard to code, it should be hard to understand."
:lol: :lol: :lol:
I'd knock on wood, but my desk is particle board.
Posts: 4,307
Threads: 63
Joined: May 2003
Bleh thats a cover up for writing sloppy code :roll:
Posts: 3,279
Threads: 170
Joined: Nov 2003
I don't comment my code, and I don't think I code sloppy (anymore)...
I only use comments where I'm approaching a difficult task and need it broken down into steps. I delete the comments afterwards.
I'd knock on wood, but my desk is particle board.
Posts: 4,307
Threads: 63
Joined: May 2003
Well i too comment on something difficult. But I leave the comments as they are if its a long term project =).
Posts: 1,774
Threads: 62
Joined: Aug 2003
Sub Hmmm(eek as MyDataType)
Code:
DECLARE SUB Hmmm (eek AS ANY)
TYPE MyDataType
X AS INTEGER
Y AS INTEGER
N AS STRING * 13
END TYPE
DIM eek AS MyDataType
eek.X = 1
eek.Y = 15
eek.N = "Dr_Davenstein"
Hmmm eek
SUB Hmmm (eek AS MyDataType)
PRINT eek.X
PRINT eek.Y
PRINT eek.N
END SUB
Posts: 4,307
Threads: 63
Joined: May 2003
Dude, make a point. Just dont post code. Its....err.....wierd =P
Posts: 1,774
Threads: 62
Joined: Aug 2003
Quote:Is there a way to define the types of arg in a sub? For exemple, set them all to integer? DEFINT doesn't work here.
define a(integer1, integer2)
That was the original post...
Quote:Dude, make a point. Just dont post code. Its....err.....wierd =P
:roll:
Dude, it isn't weard. I just assumed that he would run the code that I posted. It was just another example of how to define the types of arguements in a sub.
Posts: 1,845
Threads: 44
Joined: Aug 2002
Hehe, your code looks scary with all those 'eeks' in it... *eek*
Posts: 2,771
Threads: 96
Joined: Oct 2003
ok, heres a question which is a variation of that.
if you have an array, with a datatype, why cant you pass it into a sub?
ie why cant you:
Code:
CALL subblah(var1, var2, array(x).Z)
where subblah is a sub which calls for 3 inputs.
why cant you do this?
Posts: 6,419
Threads: 74
Joined: Mar 2002
Quote:ok, heres a question which is a variation of that.
if you have an array, with a datatype, why cant you pass it into a sub?
ie why cant you:
Code:
CALL subblah(var1, var2, array(x).Z)
where subblah is a sub which calls for 3 inputs.
why cant you do this?
as far as I know, you can.
Code:
DECLARE SUB subblah(var1%, var2%, var3%)
TYPE bleh
Z AS INTEGER
END TYPE
DIM array(10) AS bleh
CALL subblay (1, 2, array(5).Z)