Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: WebApplication VisualFoxpro

  1. #1
    Member
    Join Date
    Oct 2019
    Posts
    62

    WebApplication VisualFoxpro

    I understand correctly that if you have set Visual FoxPro as the scripting language, the app cannot be run in the browser. Just so that I can understand it, generally only the script languages ​​java, typescript and bable can be used.

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    Web browsers have native support for JavaScript, not java, thatís a different language,

    You can use JavaScript, TypeScript or Babel for client code to run in web browsers and mobile devices.

    You can call procedures on the server (from the web browser or mobile device client) that are written in Lianja/VFP, Python or JavaScript.
    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

  3. #3
    Member
    Join Date
    Oct 2019
    Posts
    62
    Excuse me. But I still don't understand the setting of the scripting language in the App Inspector -> App -> Scripting language. If I have set Visual FoxPro there all my functions which I have created in the events with Fox commands will be carried out. The disadvantage is that I cannot run the application in the browser. I get a message that the scripts cannot be executed. If I set the scripting language to JavaScript, the app is executed in the browser but the scripts that were written in Visual Foxpro during the click events are ignored. Now I have been informed several times that it is possible to run the application in the web browser with Foxpro Scripting. What do I get wrong or what do I have to set?

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,734
    Same answer.

    Web browsers have native support for JavaScript, not java, thatís a different language,

    You can use JavaScript, TypeScript or Babel for client code to run in web browsers and mobile devices.

    You can call procedures on the server (from the web browser or mobile device client) that are written in Lianja/VFP, Python or JavaScript.

    If you have written an App with VFP specified as the scripting language and you change it to JavaScript, you must remove the "Custom Library" which is a .prg file, in other words blank it out. You then need to go through your delegates and create new code which will be in JavaScript.

    When you use the App Wizard in Lianja 5 it asks you to select Desktop, Web, Tablet or Phone and will choose the language for you. Maybe you created this in an earlier version as you have been using the trial version since october it seems.


    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

  5. #5
    Member
    Join Date
    Oct 2019
    Posts
    62
    Thanks for the answer. But I want to make sure I understand it correctly. If I want to create a web application, I can not use Foxpro code, I have to use Javascipt etc. To fall back on! Correct, if I create a new app and state that I want to create the application for desktop and web, the language VisualFoxPro is no longer available. When calling the script editor, the language JavaScript (file name extension = .js) is then specified. If it is possible to enter VisualFoxPro code, what do I have to do?

  6. #6
    Senior Member
    Join Date
    Jan 2014
    Posts
    351
    Hi

    My understanding is for webapp the UI code need to be in Javascript. However, the javascript code can call VFP functions that runs on the server. The VFP functions will return values to Javascript code and can be rendered in the UI or the Javascript can call VFP functions to run updates to other database tables

    The VFP functions is called from Javascript code using Lianja.evaluate(<VFP function name>)

    I hope this helps

    Thanks & Best Regards

  7. #7
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,934
    Hi TH,

    Lianja.evaluate will work.

    And, to lessen the work in passing parameters, using exports.conf allows the VFP (or Python or PHP) function to be called on the back end. The function can then be called as it would be in the specified (in exports.conf) programming language.

    Hank

  8. #8
    Member
    Join Date
    Oct 2019
    Posts
    62
    Quote Originally Posted by HankFay View Post
    Hi TH,

    Lianja.evaluate will work.

    And, to lessen the work in passing parameters, using exports.conf allows the VFP (or Python or PHP) function to be called on the back end. The function can then be called as it would be in the specified (in exports.conf) programming language.

    Hank
    I hope I'm getting closer to it. I now understand that you can call a VFP function in the javascript code with lianja.evaluate (VFP function). then you have to store the desired VFP function under App files -> other files in the Script Editor -> exports.conf. So far I can understand this. Unfortunately, the description in the text does not help me. How should a function look like in a ButtonCommand -> Click?
    lianja.evaluate (vfpadd (10 + 20))
    In the ScriptEditor of Exports.conf I then entered the following command:
    Function vfpadd (x, z)
    wait window "calculation done!"
    return (x + z)
    Unfortunately, this did not lead to success, so I ask what I have to consider.
    Thanks for the help Greetings from Germany

  9. #9
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    1,934
    Hi Olaf,

    This page shows you how to use exports.conf: https://www.lianja.com/doc/index.php/Exports.conf

    Hank

  10. #10
    Senior Member
    Join Date
    Jan 2014
    Posts
    351
    Hi Olaf

    If you use exports.conf, you do not need Lianja.evaluate. So it is a matter of preference.

    Lianja.evaluate() is like VFP DO or RUN command. It might return value or not to the Javascript code

    Hope this helps

    Best Regards

Page 1 of 2 12 LastLast

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