Announcement

Collapse
No announcement yet.

Help: Passing Parm

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help: Passing Parm

    I would like to replace the strMode with a variable that I pass thru the script ("main", "Test") How do I put the variable in the message field? Right now the strMode will not be replaced by Test but as strmode.

    sub main(ByVal strMode As String)

    Dim InpStr As String = hs.getURL("http://test.com&message=strMode&pass...word","",False, 80)

    hs.WriteLog("Debug",strMode)

    End Sub

    Thank you for your help

  • #2
    Originally posted by aldo View Post
    I would like to replace the strMode with a variable that I pass thru the script ("main", "Test") How do I put the variable in the message field? Right now the strMode will not be replaced by Test but as strmode.

    sub main(ByVal strMode As String)

    Dim InpStr As String = hs.getURL("http://test.com&message=strMode&pass...word","",False, 80)

    hs.WriteLog("Debug",strMode)

    End Sub


    Thank you for your help
    I think this is what you want to do.

    Sub main(ByVal strMode As String)

    Dim InpStr As String = hs.GetURL("http://test.com&message=" & strMode & "&pass...word", "", False, 80)

    hs.WriteLog("Debug", InpStr)

    End Sub

    you need to split the string and place the param in the middle. use " to end the string then & to add the param then & to add the second string which should start with "

    so you are missing the " & strMode & "

    I guess you want to print the result to the log so the log should be Sub main(ByVal strMode As String) not hs.WriteLog("Debug",strMode)



    Greig
    Zwave = Z-Stick, 3xHSM100� 7xACT ZDM230, 1xEverspring SM103, 2xACT HomePro ZRP210.
    X10 = CM12U, 2xAM12, 1xAW10, 1 x TM13U, 1xMS13, 2xHR10, 2xSS13
    Other Hardware = ADI Ocelot + secu16, Global Cache GC100, RFXtrx433, 3 x Foscams.
    Plugings = RFXcom, ActiveBackup, Applied Digital Ocelot, BLDeviceMatrix, BLGarbage, BLLAN, Current Cost, Global Cache GC100,HSTouch Android, HSTouch Server, HSTouch Server Unlimited, NetCAM, PowerTrigger, SageWebcamXP, SqueezeBox, X10 CM11A/CM12U.
    Scripts =
    Various

    Comment


    • #3
      Greig,
      Your help was very much appreciated, it worked great.

      Thanks

      Comment

      Working...
      X