Results 1 to 7 of 7

Thread: Assign VFP variable values from JS

  1. #1
    Member
    Join Date
    Nov 2013
    Posts
    77

    Assign VFP variable values from JS

    hi,

    I have a javascript variable in my webview section by the name of "message". This variable has a string. How do I assign this value to one of my VFP variables?

    Code:
    Lianja.execute("VFPVariable = message")
    doesn't seem right :-)

    And another thing. I want to "blank out" one of my VFP variables from javascript / webview. So the command would be
    Code:
    Lianja.execute("VFPVariable =""")
    This doesn't work either. Kindly suggest.

    Cheers,
    Murali

  2. #2
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,379
    Hi Murali,

    Code:
    Lianja.execute("VFPVariable  = '" + message + "'");
    and

    Code:
    Lianja.execute("VFPVariable  = ''");
    Strings can be delimited with double-quotes "", single quotes '', or square brackets []. This allows you to have quotes within quotes.

    Regards,

    Yvonne

  3. #3
    Member
    Join Date
    Nov 2013
    Posts
    77
    hi Yvonne,

    Thanks. I should have known that :-D

    Cheers,
    Murali

  4. #4
    Member
    Join Date
    Nov 2013
    Posts
    77
    hi,

    If I am executing something similar to
    Code:
    Lianja.execute("VFPVariable  = '" + message + "'");
    from php, will it still be + message + ? Or will this operator(+) change depending on the scripting language?

    I have this php page where I have the following code

    Code:
    $route_count = 5; // Numeric
    // Now assign this value to a VFP global (numeric)variable called "gnroutecount"
    Lianja.execute('gnroutecount = ' + $route_count);
    Is that the right way?

    Thanks & Regards,
    Murali

  5. #5
    Member
    Join Date
    Nov 2013
    Posts
    77
    oops ....the below works
    Code:
    $route_count = 5; // Numeric
    // Now assign this value to a VFP global (numeric)variable called "gnroutecount"
    Lianja.execute('gnroutecount = ' . $route_count);
    So use the (scripting)language specific concatenator when doing such operations. For a while I was thinking that as these methods are of Lianja object, they are probably the same, irrespective of the scripting language...duh

    Cheers,
    Murali

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,771
    Exactly. The Lianja system object property accessors and method calls need to adhere to the host scripting language syntax. In this case PHP. It's good to see you exploring the integration of the scripting languages.
    Last edited by barrymavin; 2014-01-12 at 01:33.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  7. #7
    Member
    Join Date
    Nov 2013
    Posts
    77
    hi,

    Cool....thanks

    Cheers,
    Murali

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us