i have designed a print program that i have found that it now needs to be called by an API that is found on another program. it is to call some paramiters from my program such as PASSWORD AND RAFFLEID what do i need to do to get this to work. here is the code used to call my program:
at this time just for RAFFLEID AND PASSWORD.
code follows:____________________________
Sub ParseCommandLine(CmdLine, RaffleID, Password,
FirstTicketNo,
LastTicketNo)
' There will be either 3 or 4 parameters
' If there are only 3 then the third is last
ticket no and a first
ticket no of 1 is implied
' If there are 4 then the third is first ticket no
and the fourth is
last ticket no
' The first 2 args are always password and
RaffleID
Password = GetNextArgument(CmdLine)
RaffleID = GetNextArgument(CmdLine)
FirstTicketNo = GetNextArgument(CmdLine)
LastTicketNo = GetNextArgument(CmdLine)
If LastTicketNo = "" Then
LastTicketNo = FirstTicketNo
FirstTicketNo = 1
End If
End Sub
Function GetNextArgument(CmdLine)
Index = InStr(CmdLine, " ")
If (Index = 0) Then
'End of line
GetNextArgument = CmdLine
GetNextArgument = Replace(CmdLine, """", "")
'Remove double
quotes
CmdLine = ""
Exit Function
End If
GetNextArgument = Left(CmdLine, Index)
GetNextArgument = Replace(GetNextArgument, """",
"") 'Remove double
quotes
CmdLine = Right(CmdLine, Len(CmdLine) - Index)
End Function
end Code___________________________
at this time just for RAFFLEID AND PASSWORD.
code follows:____________________________
Sub ParseCommandLine(CmdLine, RaffleID, Password,
FirstTicketNo,
LastTicketNo)
' There will be either 3 or 4 parameters
' If there are only 3 then the third is last
ticket no and a first
ticket no of 1 is implied
' If there are 4 then the third is first ticket no
and the fourth is
last ticket no
' The first 2 args are always password and
RaffleID
Password = GetNextArgument(CmdLine)
RaffleID = GetNextArgument(CmdLine)
FirstTicketNo = GetNextArgument(CmdLine)
LastTicketNo = GetNextArgument(CmdLine)
If LastTicketNo = "" Then
LastTicketNo = FirstTicketNo
FirstTicketNo = 1
End If
End Sub
Function GetNextArgument(CmdLine)
Index = InStr(CmdLine, " ")
If (Index = 0) Then
'End of line
GetNextArgument = CmdLine
GetNextArgument = Replace(CmdLine, """", "")
'Remove double
quotes
CmdLine = ""
Exit Function
End If
GetNextArgument = Left(CmdLine, Index)
GetNextArgument = Replace(GetNextArgument, """",
"") 'Remove double
quotes
CmdLine = Right(CmdLine, Len(CmdLine) - Index)
End Function
end Code___________________________