Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Accessing variables from function to function

Author  Topic 

igorblackbelt
Constraint Violating Yak Guru

407 Posts

Posted - 2006-06-01 : 11:29:09
Hey Guys -
Not sure if I could add this to my old topic... Anyway, can I access variable from get_V1Records and put them into get_V2Records ? I need the Dates on the get_V2Records.

See below.

'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Function V1
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function get_V1Records(lineread)

recordtype = mid(lineread,1,1)
date1 = mid(lineread, 2, 9)
date2 = mid(lineread, 10, 17)
record = mid(lineread, 18, 280)
fullrecord = recordtype & date1 & date2 & record & "|"

if recordtype = "1" then
V1RecordFile.WriteLine(fullrecord)
end if

End Function


'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Function V2
'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function get_V2Records(lineread)

recordtype = mid(lineread,1,1)
record1 = mid(lineread, 2, 280)
' record2 = mid(lineread, 261, 280)
fullrecord = recordtype & record1

if recordtype = "2" then
V2RecordFile.WriteLine(fullrecord)
end if

End Function



---

Thanks!
Igor.

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-06-01 : 12:47:24
quote:
Originally posted by igorblackbelt


... can I access variable from get_V1Records and put them into get_V2Records ?
I need the Dates on the get_V2Records.



What do u mean by "Access", "Put" & "need"

Do u want to use both functions with same variable value ?
or do u want to use a function within the other ?

Srinika
Go to Top of Page
   

- Advertisement -