Often I see API functions that one or more of the parameters passed into the function, is a reply that you need back (besides the actual reply) but I am unsure how I would do the same in PB (if its even possible).
Since this statement sounds counter-intuitive, below is a sample of what I am trying to figure out.
In this example what I need is
I know its all pseudo-code, since the idea I had does not work (obviously). So I wondered how would I make it work?
Since this statement sounds counter-intuitive, below is a sample of what I am trying to figure out.
Code:
#COMPILE EXE #DIM ALL DECLARE FUNCTION TestReplies(MyStringIn AS STRING, MyStringRemain AS STRING)AS STRING FUNCTION PBMAIN () AS LONG LOCAL MyReply AS STRING LOCAL MyRemain AS STRING MyReply = TestReplies("HELLO", "") MyRemain = MyStringRemain MSGBOX MyReply MSGBOX MyRemain END FUNCTION FUNCTION TestReplies(MyStringIn AS STRING, MyStringRemain AS STRING)AS STRING MyStringRemain = MID$(MyStringIn, 3, 2) FUNCTION = MID$(MyStringIn, 4, 1) END FUNCTION
- The Reply from the function (obvious answer of course)
- What is left of the string in "MyStringRemain" (Could be the length of whats left, or something else, but for simplicity, I just wanted whats left etc..)
I know its all pseudo-code, since the idea I had does not work (obviously). So I wondered how would I make it work?
Comment