New to HTML

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

New to HTML

Post by kaveh1000 » Tue Feb 27, 2024 9:08 pm

Hi all

Sorry for my long absence!!

I have a stack that I have worked on for years. I now need to run it as a web service rather than a desktop app. Is this now an option?

the stack manipulates text using lots of LiveCode and regex. So I need a text file to be sent to it and it will send back a text file.

Thanks.

Regards
Kaveh
Kaveh

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9388
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: New to HTML

Post by richmond62 » Wed Feb 28, 2024 12:01 pm

I maybe very stupid, but what is the connexion between the thread title "New to HTML" and "So I need a text file to be sent to it and it will send back a text file."?

I don't think 'anything' is going to SEND a text file to a Livecode stack/standalone: the Livecode stack/standalone is going to have to FIND a text file and then import it.

Possibly a bit like this:

Code: Select all

on mouseUp
   answer file "Choose a TEXT file to import"
   if the result = "cancel" 
   then exit mouseUp
   else
      set the TEXT of fld "fRESULT" to URL ("file:" & it)
   end if
end mouseUp
and then, having processed it, the Livecode stack/standalone can export the contents of a field into a new text file.

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: New to HTML

Post by kaveh1000 » Wed Feb 28, 2024 1:41 pm

Hi Richmond

Great to be in touch again. Got so much help from you in the past!! I think I did not explain properly...

I have a stack where I can drop in a text file and it cleans it up for me using the handlers I have written in LiveCode. But I am the only person using LiveCode in my team. Everything else we have is web based like the rest of the universe. So in our web based application there is a text field that would normally be cleaned up in say JavaScript.

I want my code to be used as a web service. so you press a button on the web page, the text is sent to my stack and the stack sends back the clean text file.

I know there is a HTML project for LiveCode so stacks are online. I just want to know if that is now possible. Hope that is clearer...

Regards
Kaveh
Kaveh

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: New to HTML

Post by Klaus » Wed Feb 28, 2024 2:03 pm

Hi Kaveh,

since html5 does not support the clipboard or copy/paste, here a workaround for this problem:
https://forums.livecode.com/viewtopic.p ... 15#p227904
No idea if html5 can import/export text files...

Best

Klaus

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 261
Joined: Sat Aug 16, 2008 9:48 am
Location: Stockholm, Sweden
Contact:

Re: New to HTML

Post by SWEdeAndy » Wed Feb 28, 2024 5:36 pm

Klaus wrote:
Wed Feb 28, 2024 2:03 pm
No idea if html5 can import/export text files...
It can.
But I think the main issue here is to get the web deployment to act as a behind-the-scenes web service, that can be invoked without a user interface. I don’t think that is possible, as the stack and the LC engine can only function when loaded in an active web page.

A trick might be to embed the web deployment into the web page that is requesting its services, and call it from there. But it seems a bit of a cumbersome solution…
Andreas Bergendal
Independent app and system developer
WhenInSpace: https://wheninspace.se

Post Reply

Return to “HTML5”