Re: background images

2021-01-18 Thread Tim Selander via use-livecode

Thanks, Peter.

I added a little opencard script to load the image for each card, 
which is fine and solves the immediate problem.
But I was quite certain that in the past, I had a stack, with an 
image control in a background that would keep a unique image for 
each card without scripting. I must be dreaming/getting forgetful 
in my old age!


Tim Selander

On 2021.01.19 10:20, Peter Bogdanoff via use-livecode wrote:

That’s where a image that is not part of the group is useful; it’s only on that 
card. Otherwise you would have to set the background image dynamically on 
preOpenCard based on stored data about that image/card combination.

Peter Bogdanoff


On Jan 18, 2021, at 4:44 PM, Tim Selander via use-livecode 
 wrote:

Right, which is why this is so confusing. I do not want a 'shared text' image.
Each card should keep it's own unique image, but when I change the image on one 
card, all the cards end up with the same image. That is what I want to fix.

Tim Selander

On 2021.01.19 3:21, Klaus major-k via use-livecode wrote:

Hi Tim,


Am 18.01.2021 um 19:12 schrieb Tim Selander via use-livecode 
:

This is driving me nuts.

Have a 'background' group with an image. If I change the filename of an image 
on one card, ALL the cards change to that image. Yet a field in the same group 
properly will take unique values for each card.

I know I've done this before... what setting am I missing??
Dropbox link to test stack: 
https://www.dropbox.com/s/0r0ku3fw2i2pen7/test.livecode?dl=0


fields can have a "sharedtext" property, so they can hold different text on 
each card if part of a group.
Images can NOT!


Any help appreciated!

Tim Selander
Tokyo, Japan


Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: background images

2021-01-18 Thread Tim Selander via use-livecode
Right, which is why this is so confusing. I do not want a 'shared 
text' image.
Each card should keep it's own unique image, but when I change 
the image on one card, all the cards end up with the same image. 
That is what I want to fix.


Tim Selander

On 2021.01.19 3:21, Klaus major-k via use-livecode wrote:

Hi Tim,


Am 18.01.2021 um 19:12 schrieb Tim Selander via use-livecode 
:

This is driving me nuts.

Have a 'background' group with an image. If I change the filename of an image 
on one card, ALL the cards change to that image. Yet a field in the same group 
properly will take unique values for each card.

I know I've done this before... what setting am I missing??
Dropbox link to test stack: 
https://www.dropbox.com/s/0r0ku3fw2i2pen7/test.livecode?dl=0


fields can have a "sharedtext" property, so they can hold different text on 
each card if part of a group.
Images can NOT!


Any help appreciated!

Tim Selander
Tokyo, Japan


Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


background images

2021-01-18 Thread Tim Selander via use-livecode

This is driving me nuts.

Have a 'background' group with an image. If I change the filename 
of an image on one card, ALL the cards change to that image. Yet 
a field in the same group properly will take unique values for 
each card.


I know I've done this before... what setting am I missing??

Dropbox link to test stack: 
https://www.dropbox.com/s/0r0ku3fw2i2pen7/test.livecode?dl=0


Any help appreciated!

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: multi line Livecode field uploaded to MySQL

2019-02-16 Thread Tim Selander via use-livecode

Thank you!

It didn't quite work for me at first, but in re-reading the 
Dictionary on revExecuteSQL and reading BYU's page on the 
subject, I got it working.


Really appreciate your help.

Tim Selander
Tokyo

On 2019.02.16 18:17, Ludovic THEBAULT via use-livecode wrote:



Le 16 févr. 2019 à 09:17, Tim Selander via use-livecode 
 a écrit :

Thank you for your reply, but I haven't gotten it working yet.

The code in my first post was from my working stack. Here is what I have from 
my non-working stack after re-writing to follow your instructions:

# Construct SQL
put "INSERT INTO 
contactInfo(key,organization,denomination,address,category,tel,fax,tEmail,access,founded,staff,servicetime,web,character)"
 & \
" VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)" into tSQL
# Execute SQL
revExecuteSQL(gconnection,tSQL,vkey,vorg,vdenom,vadd,vcategory,vtel,vfax,vtEmail,vaccess,vfounded,vstaff,vtime,vweb,vcat)
put the result into tTmp


The table name is "contactInfo" and the list of the table's fields is in the 
paranthesis.

The VALUES(:1,:2  syntax is something I haven't seen before. I assume that 
you need as many numbers as you have fields?

You say to use variables, and I am assuming in the "revExecuteSQL" line. Is that correct? 
I tried the list of variables both with the quotes you used, and without just to see. I also tried 
replacing the revExecuteSQL comman with revdb_execute. Both result in this error: {execution error 
at line n/a (External handler execution error: revdberr,syntax error) near "revdberr,syntax 
error"}

I appreciate your taking the time to educate me.

Tim Selander




Here an example :

put fld "name" into tName

put the label of btn "title" into tTitle
put fld "first_name" into fFirst_Name

put fld "address" into tAddress

put fld "citycode" into tCitycode

put fld "tCity" into tCity

put fld "tPhone" into tPhone

put fld "tEmail" into tEmail

put "INSERT INTO address ( tAddress, tCitycode, tEmail, tName, fFirst_Name, tPhone, 
tTitle, tCity) VALUES ( :1, :2, :3, :4, :5, :6, :7, :8 );" into tSQL
revExecuteSQL tDatabaseID, tSQL, "tAddress", "tCitycode", "tEmail", "tName", "fFirst_Name", 
"tPhone", "tTitle", "tCity"

//The quote are necessary in last line
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: multi line Livecode field uploaded to MySQL

2019-02-16 Thread Tim Selander via use-livecode

Thank you for your reply, but I haven't gotten it working yet.

The code in my first post was from my working stack. Here is what 
I have from my non-working stack after re-writing to follow your 
instructions:


# Construct SQL
 put "INSERT INTO 
contactInfo(key,organization,denomination,address,category,tel,fax,email,access,founded,staff,servicetime,web,character)" 
& \

" VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14)" into tSQL
# Execute SQL
revExecuteSQL(gconnection,tSQL,vkey,vorg,vdenom,vadd,vcategory,vtel,vfax,vemail,vaccess,vfounded,vstaff,vtime,vweb,vcat) 


put the result into tTmp


The table name is "contactInfo" and the list of the table's 
fields is in the paranthesis.


The VALUES(:1,:2  syntax is something I haven't seen before. 
I assume that you need as many numbers as you have fields?


You say to use variables, and I am assuming in the 
"revExecuteSQL" line. Is that correct? I tried the list of 
variables both with the quotes you used, and without just to see. 
I also tried replacing the revExecuteSQL comman with 
revdb_execute. Both result in this error: {execution error at 
line n/a (External handler execution error: revdberr,syntax 
error) near "revdberr,syntax error"}


I appreciate your taking the time to educate me.

Tim Selander




On 2019.02.16 16:12, Ludovic THEBAULT via use-livecode wrote:



Le 16 févr. 2019 à 07:59, Tim Selander via use-livecode 
 a écrit :

I have a routine to take data from fields on a card and upload to a mysql 
database. Has worked well for years, got the original script off the Livecode 
learning site.
---
  # Construct SQL
  put "INSERT INTO 
podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" 
& \
   " VALUES(" & tRowData & ")" into tSQL
   # Execute SQL
   put revdb_execute(gconnection,tSQL) into tTmp

   if the result is not 1 then
 put the result && tSQL & return after message
  end if
-

tRowData has the data from the card fields, comma delimited.

Now, I'm needing to upload fields with multiple lines. But the returns in the 
data mess it up. Tried enclosing the field data in quotes, like .csv files, but 
that didn't work either.

MySQL can handle multi-line text fields so how do I upload them from LC? 
Any hints greatly appreciated.



Hello,

use this syntax :

  put "INSERT INTO 
podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" 
& \
   " VALUES(:1,:2,:3,:4,:5,:6,:7,:8,:9)" into tSQL
   # Execute SQL
   revExecuteSQL 
gconnection,tSQL,"IP","accesstime","access_date","pgm_name","access_code","bytes","agent","city","region
 », "country »)
put the result into tTmp

// where IP, accesstime… are variables

Ludovic

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

multi line Livecode field uploaded to MySQL

2019-02-15 Thread Tim Selander via use-livecode
I have a routine to take data from fields on a card and upload to 
a mysql database. Has worked well for years, got the original 
script off the Livecode learning site.

---
  # Construct SQL
  put "INSERT INTO 
podcast(IP,accesstime,access_date,pgm_name,access_code,bytes,agent,city,region,country)" 
& \

   " VALUES(" & tRowData & ")" into tSQL
   # Execute SQL
   put revdb_execute(gconnection,tSQL) into tTmp

   if the result is not 1 then
 put the result && tSQL & return after message
  end if
-

tRowData has the data from the card fields, comma delimited.

Now, I'm needing to upload fields with multiple lines. But the 
returns in the data mess it up. Tried enclosing the field data in 
quotes, like .csv files, but that didn't work either.


MySQL can handle multi-line text fields so how do I upload 
them from LC? Any hints greatly appreciated.


Tim Selander
Tokyo

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Images and Players in "background" groups

2019-02-03 Thread Tim Selander via use-livecode

Hi Peter,

Thanks for the info.
It took a little playing around, but I now have each card loading 
up properly with it's association image or video file.


Thanks!

Tim Selander
Tokyo

On 2019.02.03 16:42, Peter Bogdanoff via use-livecode wrote:

Hi Tim,

That would be correct. To have a different image on every card, you could:

1. Have an image control that’s not part of the group on every card
or
2. Some other method of dynamically loading the image data into an image that 
is part of the group, such as on openCard:

put URL tURL into image “My Image" of this card

where tURL is a path to a local or remote file.

Player controls would use similar methods as above.

Peter Bogdanoff



On Feb 2, 2019, at 10:55 PM, Tim Selander via use-livecode 
 wrote:

For the first time ever, probably, I have a little project that needs the HC "stack 
of cards" structure.

Have a few buttons and fields in a group, acting a a background and it all 
works as expected.

However, I also have an image and a play in the group/background. Oddly, when I set one 
card's image via "set the filename of image to URL" it puts that image or 
video on ALL the cards.

So the bg flds can all have different values per card, but the images and 
players cannot!

Is this right?? I have searched the dictionary and google to no avail

Tim Selander
Tokyo

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Images and Players in "background" groups

2019-02-02 Thread Tim Selander via use-livecode
For the first time ever, probably, I have a little project that 
needs the HC "stack of cards" structure.


Have a few buttons and fields in a group, acting a a background 
and it all works as expected.


However, I also have an image and a play in the group/background. 
Oddly, when I set one card's image via "set the filename of image 
to URL" it puts that image or video on ALL the cards.


So the bg flds can all have different values per card, but the 
images and players cannot!


Is this right?? I have searched the dictionary and google to no 
avail


Tim Selander
Tokyo

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Writing a UTF8 text file to server -- solved

2018-10-04 Thread Tim Selander via use-livecode

Just for posterity...

Tried many combinations of various commands opening the file 
as a binfile instead of a text file solved my problem


Changed:
open file vfile for utf8 text update

To:
open file vfile for binary update

At which point the same command:
write vdata to file vfile at end

properly saved the data as utf8/kanji to the file on the server.

All's well that ends well.

Tim Selander
Tokyo, Japan



On 2018.10.04 15:48, Tim Selander via use-livecode wrote:

Hi Scott,

Added info; I have  at the top of the web page source.

Then, I only found outputTextEncoding in the dictionary. It said
it only works with CGI (server), put when I put:
set the outputTextEncoding to "utf-8"

into the script before dealing with the $_POST array, it broke
the Kanji on the web page itself.

Googling turned up info on the textEncode function, but this
script still results with a saved file of gibberish and not Kanji.

Changed the script to this:
put $_POST[firstname]  --(Results in Kanji name to web page)
put "data.txt" into vfile
open file vfile for utf8 text update
put textEncode($_POST[firstname], "UTF-8") into vdata
write vdata to file vfile at end
close file vfile

but still get a file with broken kanji.

Any hints?

Tim




On 2018/10/04 15:08, scott--- via use-livecode wrote:

Hello Tim,

Did you look at the textEncode function?

—
Scott Morrow


On Oct 3, 2018, at 10:22 PM, Tim Selander via use-livecode
 wrote:

I am using Livecode Server on Livecode's hosting plan.

Taking my first stab at a web response form. I am getting the
data from $_POST fine, and when I simply do something like:
put $_POST[firstname]

the UTF8/Kanji word shows up fine in the webpage. But I am
unable to save the data to a file on the server encoded in
UTF8 (simply trying to collect the submitted data).

put "data.txt" into vfile
open file vfile for utf8 text update
put $_POST[firstname] & comma & $_POST[lastname] & comma &
$_POST[country] &  the time & return into vdata
write vdata to file vfile at end
close file vfile

Data is getting saved, but in gibberish, not in kanji/utf8.

Anyone see what I'm doing wrong?

TIA

Tim Selander
Tokyo, Japan


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage
your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Writing a UTF8 text file to server.

2018-10-04 Thread Tim Selander via use-livecode

Hi Scott,

Added info; I have charset=UTF-8" ?> at the top of the web page source.


Then, I only found outputTextEncoding in the dictionary. It said it only 
works with CGI (server), put when I put:

set the outputTextEncoding to "utf-8"

into the script before dealing with the $_POST array, it broke the Kanji 
on the web page itself.


Googling turned up info on the textEncode function, but this script 
still results with a saved file of gibberish and not Kanji.


Changed the script to this:
put $_POST[firstname]  --(Results in Kanji name to web page)
put "data.txt" into vfile
open file vfile for utf8 text update
put textEncode($_POST[firstname], "UTF-8") into vdata
write vdata to file vfile at end
close file vfile

but still get a file with broken kanji.

Any hints?

Tim




On 2018/10/04 15:08, scott--- via use-livecode wrote:

Hello Tim,

Did you look at the textEncode function?

—
Scott Morrow


On Oct 3, 2018, at 10:22 PM, Tim Selander via use-livecode 
 wrote:

I am using Livecode Server on Livecode's hosting plan.

Taking my first stab at a web response form. I am getting the data from $_POST 
fine, and when I simply do something like:
put $_POST[firstname]

the UTF8/Kanji word shows up fine in the webpage. But I am unable to save the 
data to a file on the server encoded in UTF8 (simply trying to collect the 
submitted data).

put "data.txt" into vfile
open file vfile for utf8 text update
put $_POST[firstname] & comma & $_POST[lastname] & comma & $_POST[country] &  the 
time & return into vdata
write vdata to file vfile at end
close file vfile

Data is getting saved, but in gibberish, not in kanji/utf8.

Anyone see what I'm doing wrong?

TIA

Tim Selander
Tokyo, Japan


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Writing a UTF8 text file to server.

2018-10-03 Thread Tim Selander via use-livecode

I am using Livecode Server on Livecode's hosting plan.

Taking my first stab at a web response form. I am getting the data from 
$_POST fine, and when I simply do something like:

put $_POST[firstname]

the UTF8/Kanji word shows up fine in the webpage. But I am unable to 
save the data to a file on the server encoded in UTF8 (simply trying to 
collect the submitted data).


put "data.txt" into vfile
open file vfile for utf8 text update
put $_POST[firstname] & comma & $_POST[lastname] & comma & 
$_POST[country] &  the time & return into vdata

write vdata to file vfile at end
close file vfile

Data is getting saved, but in gibberish, not in kanji/utf8.

Anyone see what I'm doing wrong?

TIA

Tim Selander
Tokyo, Japan


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using the $_POST global in LiveCode server

2018-08-02 Thread Tim Selander via use-livecode

Thanks, Mike.

This seemed like a good hint/possible solution.

Another though has just occurred to me also..  If you use session
variables, you can store the search term in the session, and since the
browser will re-post on reload, if $_POST and your session variable contain
the same search term, its possible (likely?) that it was a reload rather
than a new search, then don't do the search. Not sure if this is helpful,

However, when I tried

and the server returned the error

file "/home/pba/public_html/lifelinesearch.lc"
  row 2, col 1:

This snippet is at the very top of the page, so row 2 is "start session."

Am I misundertanding the syntax of 'session'?

Thanks,

Tim



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Using the $_POST global in LiveCode server

2018-08-02 Thread Tim Selander via use-livecode

Hi,

Is it possible to change, or even delete, the $_POST[] array in LiveCode 
server? I want to clear it after my script has pulled out the info it needs.


Or, maybe there's another way to skin the cat. I have a search page that 
returns a list of our online TV programs. But even if the page is 
reloaded, the previous search term is still "live" in the $_P, so the 
page returns the previously searched list of programs. If a user reloads 
the page, I want the page to come up with no program list until they 
enter a new search term.


Any pointers?

Thanks!

Tim Selander
Tokyo Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


$_POST[] variable?

2018-08-02 Thread Tim Selander via use-livecode

Hi,

Is it possible to manipulate the contents of the $_Post[] global 
directly on Livecode serve?


When I reload a page, the values in the array still have the values in 
them from the previous time the "Submit" button was used... efforts to 
delete or put empty into, do not seem to work.


Thanks.

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: UTF8 on LC server

2018-06-01 Thread Tim Selander via use-livecode

Mark,

Success!  Greatly appreciate your walking me through this.

Have a great weekend.

Tim Selander
Tokyo, Japan


On Fri, Jun 1, 2018 at 7:15 AM, Mark Waddingham via use-livecode <

use-livecode@lists.runrev.com> wrote:


On 2018-06-01 12:53, Tim Selander via use-livecode wrote:


Hi Mark,

Here is the script. The files I'm using are
bamboobabies.com/getjapanesetext.lc, and the text it is getting is
bamboobabies.com/news.txt.

In the script, there are two lines reading the text file that I've
taken turns commenting out

If you can give me any hints, it would be greatly appreciated.

Tim Selander





 
 
 workbench
 


http://bamboobabies.com/news.txt; into vText

--When this line is used, none of the put text is readable
--put textDecode(url "binfile:bamboobabies.com/news.txt", "utf-8") into
vText

put line 1 of vText

put ""

put char 500 to 550 of vText
  ?>





Try this:





 
 
 workbench
 

http://bamboobabies.com/news.txt;, "utf-8") into vText

put line 1 of vText

put ""

put char 500 to 550 of vText
  ?>



The problem you are having is that your text-file is UTF-8, but the engine
doesn't know that - you need to explicit decode it into a LiveCode string
using textDecode. You can then manipulate it as chars etc. correctly with
Unicode. That solves the 'getting data into livecode in the form needed'
problem.

The other side of the problem is the text encoding used when you do 'put'.
By default this is 'native' - by setting the outputTextEncoding at the
start, the engine will automatically encode any strings you 'put' with the
encoding specified.

Hope this helps!

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: UTF8 on LC server

2018-06-01 Thread Tim Selander via use-livecode

Hi Mark,

Here is the script. The files I'm using are 
bamboobabies.com/getjapanesetext.lc, and the text it is getting 
is bamboobabies.com/news.txt.


In the script, there are two lines reading the text file that 
I've taken turns commenting out


If you can give me any hints, it would be greatly appreciated.

Tim Selander








workbench



--This line loads readable japanese text, but putting char 500 to 
550 breaks beginning and ending kanji

put url "http://bamboobabies.com/news.txt; into vText

--When this line is used, none of the put text is readable
--put textDecode(url "binfile:bamboobabies.com/news.txt", 
"utf-8") into vText


put line 1 of vText

put ""

put char 500 to 550 of vText
 ?>






On 2018.06.01 16:17, Mark Waddingham via use-livecode wrote:


You should be fine using 'character' on any unicode text - it
uses the Unicode grapheme (specific name of 'character's as
human's 'think' of 'character's) breaking rules to find the
boundaries.

That being said, I think codepoint (from memory) should also be
okay on Japanese text as I don't think the Japanese/Chinese
scripts have any multi-codepoint characters - they just use
codepoints with value > 65535 for less used ideographs (the
'supplementary plane'). [ Korean script can be encoded with
Hangul, which *does* require the use of character as a single
Korean Hangul ideograph can be composed of up to three codepoints ].

The fact it is breaking on Japanese text in the way you suggest
makes me think you aren't textDecode()'ing your UTF-8 input files:

e.g.
put textDecode(url ("binfile:"), "utf-8") into tText

Without decoding as utf-8, the engine will thing your file is
'native' (single-byte encoded), so each byte of the file will be
seen as a separate character.

Internally the engine uses either single-byte or double-byte
encodings for strings (the latter being UTF-16) - which is not
user-visible, you just need to make sure that incoming data is
decoded correctly.

Can you share the code you are using to read in the text data and
code which is breaking on server?

Warmest Regards,

Mark.

P.S. 'word' in LC is still any sequence of non-space characters
separated by spaces, or any sequence of characters delimited by
quotes - it takes no account of the script of the text, nor
actual word-boundaries. If you want human-style word boundaries
then you should use trueWord (which uses the standard Unicode
word breaking rules).



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: UTF8 on LC server

2018-05-31 Thread Tim Selander via use-livecode

Hi Kee and Alex,

The original documents I'm working with are UTF8, so that's that I've 
been using. So converting them to UTF16 is recommended? I'll try that.


Alex, desktop is version 8 something, and the server is the one 
installed on the on-rev host; can't remember what the key in $_Server 
for than info is, and Googling failed me this time...


Tim Selander

On 2018/06/01 8:55, kee nethery via use-livecode wrote:

I’m assuming you are using “unicode” (aka UTF-16) and not UTF8 to do all your 
transforming of the data?
Kee


On May 31, 2018, at 4:46 PM, Tim Selander via use-livecode 
 wrote:

Thanks, Kee.

Actually, I had found the reference to codepoint in the dictionary and tried it. But it seems to 
work the same as character -- breaking kanji. My test code is "put codepoint 500 to 550 of 
variable1" and the webpage shows: �。こうして夕があり、朝があった。�  The beginning and ending kanji got split 
in half. Identical results to "put char 500 to 550."

Tim Selander

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: UTF8 on LC server

2018-05-31 Thread Tim Selander via use-livecode

Thanks, Kee.

Actually, I had found the reference to codepoint in the dictionary and 
tried it. But it seems to work the same as character -- breaking kanji. 
My test code is "put codepoint 500 to 550 of variable1" and the webpage 
shows: �。こうして夕があり、朝があった。�  The beginning and ending 
kanji got split in half. Identical results to "put char 500 to 550."


Tim Selander


On 2018/06/01 8:39, kee nethery via use-livecode wrote:



On May 31, 2018, at 4:33 PM, Tim Selander via use-livecode 
 wrote:

Thanks, Warren.

Yes, I've got that header set up, and UTF8 is working fine, pages look great. But LC server is not 
handling character chunking in variables the same way as LC desktop. In desktop, I can say 
"put char 1 of variable1" and I get a Japanese kanji. In LC Server, I only get half a 
kanji. "Word" chunks are also not working. Items and lines are OK.

Yep, “char" is no longer the thing to use. Use “codepoint”.
put codepoint 1 of variable1

Kee Nethery


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: UTF8 on LC server

2018-05-31 Thread Tim Selander via use-livecode

Thanks, Warren.

Yes, I've got that header set up, and UTF8 is working fine, pages look 
great. But LC server is not handling character chunking in variables the 
same way as LC desktop. In desktop, I can say "put char 1 of variable1" 
and I get a Japanese kanji. In LC Server, I only get half a kanji. 
"Word" chunks are also not working. Items and lines are OK.


I never got the hange of all the encodes and decodes needed for Japanese 
in LC 6 and earlier... but does LC server require those kinds of text 
manipulations?


Tim Selander
Tokyo, Japan

On 2018/06/01 6:43, Warren Samples via use-livecode wrote:

On 05/31/2018 06:43 AM, Tim Selander via use-livecode wrote:
Is there any way to get LC Server to handle double-byte characters 
the same way LC desktop does?


Tim Selander
Tokyo, Japan


LC Server serves pages with a default "Content-Type" header of:

Content-Type: text/html; charset=iso-8859-1

That would prevent the display of Japanese characters.

Try putting:

put header "Content-Type: text/html; charset=utf-8"

at the top of your lc pages after the Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


UTF8 on LC server

2018-05-31 Thread Tim Selander via use-livecode

Hi,

In LC, if I have a field or variable in Japanese (double-byte) 
and get, say, the 5th character, it returns the correct 
double-byte character. But on LC server (on-rev hosting) 
"character" commands get single bytes, breaking the Japanese 
character turning it into gibberish.


Is there any way to get LC Server to handle double-byte 
characters the same way LC desktop does?


Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: another mac to Windows gotcha

2018-02-24 Thread Tim Selander via use-livecode

Hi Peter,

Tried
if pkeyname is "j" then
set the playrate of player videoplayer to -1
start player videplayer
end if

Results in a pause in playback as long as I am holding ctrl-j, as 
soon as that's released, forward play resumes.


Thanks.

Tim


On 2018.02.25 0:26, Peter Bogdanoff via use-livecode wrote:

Tim,

Try both commands in order: set playRate, then start.

Peter Bogdanoff


On Feb 24, 2018, at 10:16 AM, Tim Selander via use-livecode 
<use-livecode@lists.runrev.com> wrote:

Hi Paul,

Using 9.0 dp11 community. After sending the post, I found in the dictionary 
that for windows, commandkeydown message. After changing my script from 
controlkeydown to commandkeydown, it worked. Sort of.

My next problem is that on the LC/osx I use:
  if pkeyname is "j" then set the playrate of player videoplayer to -1
  if pkeyname is "k" then set the playrate of player videoplayer to 0
  if pkeyname is "l" then set the playrate of player videoplayer to 1

to start, stop or reverse the player from the keyboard. This worked great in 
LC/osx, but is not working in win7/LC.

I changed the lines to
  if pkeyname is "k" then stop player videoplayer
  if pkeyname is "l" then start player videoplayer

and that works in win7/lc. But can't figure out how to send a play in reverse 
command from the keyboard yet.

Tim Selander
Tokyo, Japan



On 2018.02.24 23:44, Paul Dupuis via use-livecode wrote:
controlKeyDown is absolutely available on Windows. See the dictionary
entry in LC8.1.9 for example. What version of LiveCode are you using?



On 2/24/2018 9:04 AM, Tim Selander via use-livecode wrote:
Hi,

Trying my first little LC app on Windows. I wrote an app on osx and am
now trying to get it to work in a Win7 machine.

On the mac app, I use ctrl-J, ctrl-K, and ctrl-L to control the video
player. JKL is pretty standard video player control in video editing
software.

On the mac app, the card script 'listens' for controlkeydown, and if
the other key is J K or L, sends the appropriate go, stop, reverse
command to the player.

Have just discovered controlkeydown is not available on windows. Is
there an equivalent? What would the windows guy and gals here use?

Thanks,

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: another mac to Windows gotcha

2018-02-24 Thread Tim Selander via use-livecode

Hi Paul,

Using 9.0 dp11 community. After sending the post, I found in the 
dictionary that for windows, commandkeydown message. After 
changing my script from controlkeydown to commandkeydown, it 
worked. Sort of.


My next problem is that on the LC/osx I use:
  if pkeyname is "j" then set the playrate of player videoplayer 
to -1
  if pkeyname is "k" then set the playrate of player videoplayer 
to 0
  if pkeyname is "l" then set the playrate of player videoplayer 
to 1


to start, stop or reverse the player from the keyboard. This 
worked great in LC/osx, but is not working in win7/LC.


I changed the lines to
  if pkeyname is "k" then stop player videoplayer
  if pkeyname is "l" then start player videoplayer

and that works in win7/lc. But can't figure out how to send a 
play in reverse command from the keyboard yet.


Tim Selander
Tokyo, Japan


On 2018.02.24 23:44, Paul Dupuis via use-livecode wrote:

controlKeyDown is absolutely available on Windows. See the dictionary
entry in LC8.1.9 for example. What version of LiveCode are you using?


On 2/24/2018 9:04 AM, Tim Selander via use-livecode wrote:

Hi,

Trying my first little LC app on Windows. I wrote an app on osx and am
now trying to get it to work in a Win7 machine.

On the mac app, I use ctrl-J, ctrl-K, and ctrl-L to control the video
player. JKL is pretty standard video player control in video editing
software.

On the mac app, the card script 'listens' for controlkeydown, and if
the other key is J K or L, sends the appropriate go, stop, reverse
command to the player.

Have just discovered controlkeydown is not available on windows. Is
there an equivalent? What would the windows guy and gals here use?

Thanks,

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


another mac to Windows gotcha

2018-02-24 Thread Tim Selander via use-livecode

Hi,

Trying my first little LC app on Windows. I wrote an app on osx 
and am now trying to get it to work in a Win7 machine.


On the mac app, I use ctrl-J, ctrl-K, and ctrl-L to control the 
video player. JKL is pretty standard video player control in 
video editing software.


On the mac app, the card script 'listens' for controlkeydown, and 
if the other key is J K or L, sends the appropriate go, stop, 
reverse command to the player.


Have just discovered controlkeydown is not available on windows. 
Is there an equivalent? What would the windows guy and gals here use?


Thanks,

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


playing a video in Win7?

2018-02-24 Thread Tim Selander via use-livecode

Hi,

Trying to simply play an h264 video on LC 9 in a player on a Win7 
machine. Quicktime installed. I have .mov, .mp4, .mv4 videos that 
all play fine on Mac osx /and/ in QT on the Win7 machine. But I 
can only get .wmv to play in the LC player object on Win7.


Have to create a little in-house app for a Win7 user...  Very 
first time to use LC on Windows.


Any hints?

Much appreciated.

Tim Selander
Tokyo, Japan


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Getting current line number of a table field.

2018-02-14 Thread Tim Selander via use-livecode

Hi Mike,

Thanks! I put the script in the table field itself with no luck. 
But when I moved it to the card script, it works! Great! I never 
would have come up with that in a million years.


This list is fantastic.

Oh, and I just re-named the table field to "Opera"  ;-)

Tim Selander
Tokyo, Japan

On 2018.02.15 1:04, Mike Bonner via use-livecode wrote:

Try this...

on rawkeyup pkey
send "getline" to me in 10 millisec
pass rawkeyup
end rawkeyup

command getline
put the short name of the focusedobject
end getline

This gives you the name of the editing field that appears for each cell in
the form of:

revCell-2,2

Parse that and voila, you have your info.

On Wed, Feb 14, 2018 at 8:35 AM, dunbarx via use-livecode <
use-livecode@lists.runrev.com> wrote:


You know, this proved more of a problem than I thought.

Richmond, the issue is with tab and return keyPresses, not mouse clicks.
Anyway, given a table field 1 and another field 2, this works if you tab or
return in the table field:

on rawKeyUp tKey
put the selectedLoc && the selectedChunk into fld 2
pass rawKeyUp
end rawKeyUp

And this works fine in a button:

on mouseUp
set the itemDel to tab
select item 2 of line 2 of fld 1
answer the selectedLine of fld 1
end mouseUp

But this does not in the table field:
on rawKeyDown tKey
put "" into fld 2
put the selectedLine into fld 2
pass rawKeyDown
end rawKeyDown

I always get "line 1 of field 3"  ()

  Kluge city to get the line from the selectedLoc, but that would indeed
work.

Is it that in a table field, if only one "cell" is selected, the
selectedLine just does not compute?

Craig Newman






--
Sent from: http://runtime-revolution.278305.n4.nabble.com/
Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Getting current line number of a table field.

2018-02-14 Thread Tim Selander via use-livecode

Hi,

Editing a table field (not datagrid) and need to track the number 
of the line that is being edited. If I click into a new line, 
"selectionchanged" will let me figure out what line I'm editing. 
But if I hit return or tab to go to a new line, how can I track 
what line the cursor is in? Rawkeyups and downs are being sent, 
but I have been unsuccessful in trapping them in the table 
field's script.


Any ideas?
Much appreciated.

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Getting directory list from web server??

2017-11-06 Thread Tim Selander via use-livecode

Hi,

Up until now, in my livecode server script,

put URL "http://www.myserver.com/radio/15/; after vlist

has gotten me text list of the directory contents.

Now it gets me a "You don't have permission to access." error message.

on-rev hosting, "sage" is the server.

Anyone know what is going on?

TIA

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sending an FTP command from one web server to another?

2017-07-19 Thread Tim Selander via use-livecode

Richard,

Have never written a CGI in my life but you got me thinking; a 
quick Google found me a php script to "print" a folder listing.


So now my .lc script on my on-rev serve puts the url of the .php 
page on the server with the mp3s into a variable -- which gives 
me the list of file names I was trying to get via ftp. Works slick.


Thanks!

Tim Selander
Tokyo, Japan

On 2017.07.19, 2:16, Richard Gaskin via use-livecode wrote:

Tim Selander wrote:

 > My company gave up on hosting our email and website at on-rev.com
 > back when they were having lots of reliability problems. We're
using
 > a host in Japan; no LC server installed, nor is it installable.
 >
 > I still have our Founder's account on on-rev.com, and use
quite a few
 > .lc scripts, calling them from iframes in web pages hosted on
the new
 > host.
 >
 > Our radio programs' mp3 files are stored on the new host. I
want one
 > of my scripts on on-rev.com to get the directory listing of
the mp3
 > files on the new host.

FTP is probably not the best solution for this, for reasons too
numerable to list this morning.

But for the task as described, other simpler, more efficient, and
more secure alternatives exist:

Can you run a CGI on the server holding the MP3 files to obtain
that list?

Or, if they're within you're web root, can you use Apache's
directory listing?



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Sending an FTP command from one web server to another?

2017-07-18 Thread Tim Selander via use-livecode

Hi again Matthias,

I remembered I was given an ftp account on a colleague's server 
awhile back -- tried that and got access with both LC server and 
via ssh on sage.on-rev.


So gmoserver.jp is blocking access from sage.on-rev somehow...

Back to the drawing board.

Thanks for your time and input.

Tim


On 2017.07.18, 20:34, Matthias Rebbe via use-livecode wrote:

Hi Tim,

i had some time during lunch and  made a quick test on my on-rev account at the 
Jasmine server.
I am able to list the files of a non on-rev server without problems using 
livecode server. Jasmine runs version 7.1.0 of lc server.

Regards,
Matthias



Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌


Am 18.07.2017 um 12:50 schrieb Tim Selander via use-livecode 
<use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>:

Hi Matthias,

Good idea. I just sent support an email asking to have ssh activated!

I'll post again with results!

Tim Selander
Tokyo, Japan

On 2017.07.18, 19:12, Matthias Rebbe via use-livecode wrote:

Do you have ssh access for your on-rev  account? If not, ask support to enable 
it for you.

Try to use ftp from the commandline, just to see if gmoserver.jp <http://gmoserver.jp/> 
<http://gmoserver.jp/ <http://gmoserver.jp/>> accepts that connection. If that also 
doesn´t work, then i would assume that your server is blocking the incoming connection from 
on-rev. If that works, then  livecode server seems to have a problem with ftp outgoing 
connections.

Matthias
Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu <http://matthiasrebbe.eu/> <http://matthiasrebbe.eu/ 
<http://matthiasrebbe.eu/>>‌


Am 18.07.2017 um 10:38 schrieb Tim Selander via use-livecode <use-livecode@lists.runrev.com 
<mailto:use-livecode@lists.runrev.com> <mailto:use-livecode@lists.runrev.com 
<mailto:use-livecode@lists.runrev.com>>>:

Hi,

My company gave up on hosting our email and website at on-rev.com <http://on-rev.com/> 
<http://on-rev.com/ <http://on-rev.com/>> back when they were having lots of 
reliability problems. We're using a host in Japan; no LC server installed, nor is it installable.

I still have our Founder's account on on-rev.com <http://on-rev.com/> 
<http://on-rev.com/ <http://on-rev.com/>>, and use quite a few .lc scripts, calling 
them from iframes in web pages hosted on the new host.

Our radio programs' mp3 files are stored on the new host. I want one of my scripts on on-rev.com 
<http://on-rev.com/> <http://on-rev.com/ <http://on-rev.com/>> to get the 
directory listing of the mp3 files on the new host. The ftp command from LC tutorials works fine 
from LC desktop (Community edition, Mac) to get the filelist:
put url "ftp://user:p...@domain.com/folder/ <ftp://user:p...@domain.com/folder/> 
<ftp://user:p...@domain.com/folder/ <ftp://user:p...@domain.com/folder/>>" into myVariable

Put when I call it from the server .lc script on on-rev, the result is:
error Failed to connect to gmoserver.jp <http://gmoserver.jp/> <http://gmoserver.jp/ 
<http://gmoserver.jp/>> port 21: Connection refused

(gmoserver.jp <http://gmoserver.jp/> <http://gmoserver.jp/ 
<http://gmoserver.jp/>> is our new host here in Japan.)

Any ideas why the connection would be refused when coming from on-rev, but not 
LC desktop? Anyways around this?

Thanks in advance.

Tim Selander
Tokyo, Japan




___
use-livecode mailing list
use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Sending an FTP command from one web server to another?

2017-07-18 Thread Tim Selander via use-livecode

Hi again,

Reporting back for

RevRun support was very quick at activating ssh on my account -- 
thanks!


However, using ftp from the commandline to gmoserver.jp resulted 
in the same message: connection refused


OK, time to take a new tack on the problem!

Thanks for the tip, Matthias.

Tim Selander
Tokyo, Japan

On 2017.07.18, 19:12, Matthias Rebbe via use-livecode wrote:

Do you have ssh access for your on-rev  account? If not, ask support to enable 
it for you.

Try to use ftp from the commandline, just to see if gmoserver.jp 
<http://gmoserver.jp/> accepts that connection. If that also doesn´t work, then 
i would assume that your server is blocking the incoming connection from on-rev. If 
that works, then  livecode server seems to have a problem with ftp outgoing 
connections.

Matthias
Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌


Am 18.07.2017 um 10:38 schrieb Tim Selander via use-livecode 
<use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>:

Hi,

My company gave up on hosting our email and website at on-rev.com 
<http://on-rev.com/> back when they were having lots of reliability problems. 
We're using a host in Japan; no LC server installed, nor is it installable.

I still have our Founder's account on on-rev.com <http://on-rev.com/>, and use 
quite a few .lc scripts, calling them from iframes in web pages hosted on the new 
host.

Our radio programs' mp3 files are stored on the new host. I want one of my scripts on 
on-rev.com <http://on-rev.com/> to get the directory listing of the mp3 files 
on the new host. The ftp command from LC tutorials works fine from LC desktop 
(Community edition, Mac) to get the filelist:
put url "ftp://user:p...@domain.com/folder/ 
<ftp://user:p...@domain.com/folder/>" into myVariable

Put when I call it from the server .lc script on on-rev, the result is:
error Failed to connect to gmoserver.jp <http://gmoserver.jp/> port 21: 
Connection refused

(gmoserver.jp <http://gmoserver.jp/> is our new host here in Japan.)

Any ideas why the connection would be refused when coming from on-rev, but not 
LC desktop? Anyways around this?

Thanks in advance.

Tim Selander
Tokyo, Japan





___
use-livecode mailing list
use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: Sending an FTP command from one web server to another?

2017-07-18 Thread Tim Selander via use-livecode

Hi Matthias,

Good idea. I just sent support an email asking to have ssh activated!

I'll post again with results!

Tim Selander
Tokyo, Japan

On 2017.07.18, 19:12, Matthias Rebbe via use-livecode wrote:

Do you have ssh access for your on-rev  account? If not, ask support to enable 
it for you.

Try to use ftp from the commandline, just to see if gmoserver.jp 
<http://gmoserver.jp/> accepts that connection. If that also doesn´t work, then 
i would assume that your server is blocking the incoming connection from on-rev. If 
that works, then  livecode server seems to have a problem with ftp outgoing 
connections.

Matthias
Matthias Rebbe
+49 5741 31
‌matthiasrebbe.eu <http://matthiasrebbe.eu/>‌


Am 18.07.2017 um 10:38 schrieb Tim Selander via use-livecode 
<use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>>:

Hi,

My company gave up on hosting our email and website at on-rev.com 
<http://on-rev.com/> back when they were having lots of reliability problems. 
We're using a host in Japan; no LC server installed, nor is it installable.

I still have our Founder's account on on-rev.com <http://on-rev.com/>, and use 
quite a few .lc scripts, calling them from iframes in web pages hosted on the new 
host.

Our radio programs' mp3 files are stored on the new host. I want one of my scripts on 
on-rev.com <http://on-rev.com/> to get the directory listing of the mp3 files 
on the new host. The ftp command from LC tutorials works fine from LC desktop 
(Community edition, Mac) to get the filelist:
put url "ftp://user:p...@domain.com/folder/ 
<ftp://user:p...@domain.com/folder/>" into myVariable

Put when I call it from the server .lc script on on-rev, the result is:
error Failed to connect to gmoserver.jp <http://gmoserver.jp/> port 21: 
Connection refused

(gmoserver.jp <http://gmoserver.jp/> is our new host here in Japan.)

Any ideas why the connection would be refused when coming from on-rev, but not 
LC desktop? Anyways around this?

Thanks in advance.

Tim Selander
Tokyo, Japan




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Sending an FTP command from one web server to another?

2017-07-18 Thread Tim Selander via use-livecode

Hi,

My company gave up on hosting our email and website at on-rev.com back 
when they were having lots of reliability problems. We're using a host 
in Japan; no LC server installed, nor is it installable.


I still have our Founder's account on on-rev.com, and use quite a few 
.lc scripts, calling them from iframes in web pages hosted on the new host.


Our radio programs' mp3 files are stored on the new host. I want one of 
my scripts on on-rev.com to get the directory listing of the mp3 files 
on the new host. The ftp command from LC tutorials works fine from LC 
desktop (Community edition, Mac) to get the filelist:

put url "ftp://user:p...@domain.com/folder/; into myVariable

Put when I call it from the server .lc script on on-rev, the result is:
error Failed to connect to gmoserver.jp port 21: Connection refused

(gmoserver.jp is our new host here in Japan.)

Any ideas why the connection would be refused when coming from on-rev, 
but not LC desktop? Anyways around this?


Thanks in advance.

Tim Selander
Tokyo, Japan





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Goofy question #7234

2017-07-10 Thread Tim Selander via use-livecode

Hi Richmond

This works (both scripts in the button):
on mouseUp
put goRed()
end mouseUp

function goRed
set the backGroundColor of card 1 to red
end goRed

I think the general idea is that a function returns information. So 
date() returns the date. But just having a line "date()" in the script 
causes an error because you haven't told it what to do with the info 
being returned. So you need "put data()" and then the info will go to 
the message box.


Your function doesn't return any data. That's your choice when you write 
it. But the engine is still expecting a function to return info, so you 
still have to say "put" trigger the function.


You could write your function with a parameter:
function goRed foo
set the backGroundColor of foo to red
end goRed

Then call the function like this:
put goRed("card 1")
put goRed("card 3")
etc., and the one function can be used to turn both card 1 and card 3 
(and any other object you specify in foo) red.


Hope that helps.

Tim Selander
Tokyo, Japan





On 7/10/17, 15:48, Richmond Mathewson via use-livecode wrote:

I am obviously missing something . . .

. . . so badly so that I've been trawling Danny Goodman's "Complete" 
HC 2 . . .


and NOT getting 'it' . . .

SO: one can set up a custom command:

on GoRed
  set the backGroundColor of card 1 to red
end GoRed

and one can call it:

on mouseUp
   do GoRed
end mouseUp

and one can set up a custom function:

function GoRed
  set the backGroundColor of card 1 to red
end function

Now: is the reason I cannot call that function because it takes NO 
parameters?


Richmond.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: IP to decimal function?

2017-05-15 Thread Tim Selander via use-livecode
OK, this "master library" is new info to me! Googled it, found a brief 
reference and download link in the forums. Will now have a look at it!


Tim Selander
Tokyo, Japan


On 2017/05/16 0:01, Bob Sneidar via use-livecode wrote:

I wrote something of the sort called IPCalc. It should be in the master library.

Bob S



On May 13, 2017, at 22:25 , Tim Selander via use-livecode 
<use-livecode@lists.runrev.com> wrote:

Hi

I need to convert IP address from web logs to decimal for easier processing...

Before I try to "reinvent the wheel" (and no doubt roll off a cliff) I'm 
wondering if anyone already has such a function they'd be willing to share?

TIA

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: IP to decimal function?

2017-05-14 Thread Tim Selander via use-livecode

Hi Richmond,

Thanks for your stack! Wow!  I'm in the process of testing and 
'function-fying' it.


I did google around and found pages like your java link... but my 
arithmetic skills are so basic, it all just looked like, well, 
Sanskrit..  ;-)


Tim Selander
Tokyo, Japan

On 2017.05.14, 17:02, Richmond Mathewson via use-livecode wrote:

I almost never know anything, but I do know where to look to find
out:

https://www.mkyong.com/java/java-convert-ip-address-to-decimal-number/


Hope that spoils your Sunday :)

Richmond.

On 5/14/17 8:25 am, Tim Selander via use-livecode wrote:

Hi

I need to convert IP address from web logs to decimal for
easier processing...

Before I try to "reinvent the wheel" (and no doubt roll off a
cliff) I'm wondering if anyone already has such a function
they'd be willing to share?

TIA

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


IP to decimal function?

2017-05-13 Thread Tim Selander via use-livecode

Hi

I need to convert IP address from web logs to decimal for easier 
processing...


Before I try to "reinvent the wheel" (and no doubt roll off a 
cliff) I'm wondering if anyone already has such a function they'd 
be willing to share?


TIA

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Messages sent while mouse is down?

2017-03-11 Thread Tim Selander via use-livecode
Yes, that had occurred to me, but my explanation was too 
simplistic. While it is a Scrabble-esque game with tiles, the 
tiles are hexagons and are staggered on the board. (pic-- 
http://tinyurl.com/jjcqolm)


That still might be calculate-able, but is beyond my math skills!

Thanks,

Tim

On 2017.03.12, 10:00, Mike Bonner via use-livecode wrote:

If the names of the tiles are numbered in a logical way, and only go
horizontal, and vertical, then all you need to know is the start spot, and
the end spot, and can fill in the gaps between.


On Sat, Mar 11, 2017 at 4:06 PM, Quentin Long via use-livecode <
use-livecode@lists.runrev.com> wrote:


sez Tim Selander :

I miss the Zynga "Pathwords" game on Facebook, so for my own
amusement I'm trying to recreate it in Livecode.

For those who don't know the game, it had a solid screenful of
Scrabble-like lettered tiles. Click and drag the mouse through
adjacent letters to make words.

Without clicking, simply moving the mouse through the tiles
(fields) triggers mouseenter, mouseleave, etc. which makes it
easy to pick up the letters.

But when the mouse is down, it seems mouseloc() is the only thing
I can get. Using a variable what has all the field rectangles, I
can use the mouseloc() to ultimately identify the field under the
pointer, but it's too slow...

Does a moving mouse with the button down trigger any other
messages besides mouseloc()?

I see that Mike Bonner has already provided a solution which seems to do
what you want. But just in case there are other people out there who might
need a different solution, here's my stab at it…

If you have a "screenful of Scrabble-like lettered tiles", these "tiles"
are presumably arranged in a rectangular grid, with neatly aligned rows and
columns. If this is the case, the locations of the row-tiles are going to
be separated by X number of pixels, such that row-tile 1 has X-coördinate
A; row-tile 2 has X-coördinate (A + X); row-tile 3 has X-coordinate (A +
2*X); and so on.

Column-tiles will work similarly. Their locations will be separated by Y
number of pixels, such that column-tile 1 has Y coördinate B; column-tile 2
has Y coördinate (B + Y); column-tile 3 has Y coördinate (B + 2*Y); and so
on.

If the grid's horizontal spacing is identical to its vertical spacing, the
separation-values X and Y will be the same, of course. Given the fact that
pixels are not *necessarily* square, it would be imprudent to *assume* that
the grid's horizontal and vertical separation-values are identical, and I
will not make that assumption here.

So.

My solution to Tim Selander's problem completely ignores most of the
mouse[whatever] messages, depending strictly on mouseLoc. Like so:

local dX = 25 -- if the horizontal-spacing value is not 25, put the real
value here
local dY = 25 -- again, replace 25 with the real value as needed
local TimeSlice = 50 -- how often, in milliseconds, the code checks the
mouseLoc. adjust as needed for response time
local GridLocPulse

global GridCell = "1,1"

on GridLoc
   if (GridLocPulse) then send GridLoc to me in TimeSlice milliseconds
   put the mouseLoc into ThisLoc
   put (1 + (item 1 of ThisLoc div dX)) into item 1 of GridCell -- may need
tweaking to account for edge effects
   put (1 + (item 2 of ThisLoc div dY)) into item 2 of GridCell -- ditto
end GridLoc

on GridLocOn
   put true into GridLocPulse
   GridLoc
end GridLocOn

on GridLocOff
   put false into GridLocPulse
end GridLocOff

The above code can go into the script of the card where the tile-grid
lives.

Once every (TimeSlice) milliseconds, this code looks at the mouseLoc and
converts the mouse coördinates into grid coördinates, which are stored in
the global variable GridCell. GridCell being a global, its contents should
be accessible to any handler in any script which includes the line "global
GridCell".

It's probably a good idea to *not* have the GridLoc handler burning
clock-cycles *all the time*. Thus, the local variable GridLocPulse, and the
subsidiary handlers GridLocOn and GridLocOff. GridLocOn activates the
GridLoc handler, and GridLocOff turns GridLoc off.

Hope this helps…


"Bewitched" + "Charlie's Angels" - Charlie = "At Arm's Length"

Read the webcomic at [ http://www.atarmslength.net ]!

If you like "At Arm's Length", support it at [ http://www.patreon.com/
DarkwingDude ].

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to 

Re: Messages sent while mouse is down?

2017-03-11 Thread Tim Selander via use-livecode

Oh ho!

That does it, Mike. Many thanks!

Tim

On 2017.03.11, 18:35, Mike Bonner via use-livecode wrote:

accidental send before complete. *sigh*

on mousemove
put 1 & cr & 2 into objectList -- just using control number for the
quick example
if the mouse is down then
   repeat for each line tLine  in objectList
  if within(control tLine,the mouseloc) then
 put tLine into tResult
 exit repeat
  end if
   end repeat
end if
if tResult is not empty then
   put tResult
else
   put "no result"
end if
end mousemove

On Sat, Mar 11, 2017 at 2:30 AM, Mike Bonner <bonnm...@gmail.com> wrote:


mousemove works.  It does appear that "mousecontrol" doesn't fire when the
mouse is down so that is out.

You can also use "within" which is pretty fast.

Have a variable with a list of the objects you wish to check against (or
array, or whatever)
on mousemove

if the mouse is down then

repeat for each line tLine  in objectList

if within(tLine,the mouseloc) then
put tLine into tResult
  exit repeat
end repeat

end if
if tResult
end mousemove

On Sat, Mar 11, 2017 at 1:02 AM, Tim Selander via use-livecode <
use-livecode@lists.runrev.com> wrote:


I miss the Zynga "Pathwords" game on Facebook, so for my own amusement
I'm trying to recreate it in Livecode.

For those who don't know the game, it had a solid screenful of
Scrabble-like lettered tiles. Click and drag the mouse through adjacent
letters to make words.

Without clicking, simply moving the mouse through the tiles (fields)
triggers mouseenter, mouseleave, etc. which makes it easy to pick up the
letters.

But when the mouse is down, it seems mouseloc() is the only thing I can
get. Using a variable what has all the field rectangles, I can use the
mouseloc() to ultimately identify the field under the pointer, but it's too
slow...

Does a moving mouse with the button down trigger any other messages
besides mouseloc()?

Thanks,

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Messages sent while mouse is down?

2017-03-11 Thread Tim Selander via use-livecode
I miss the Zynga "Pathwords" game on Facebook, so for my own 
amusement I'm trying to recreate it in Livecode.


For those who don't know the game, it had a solid screenful of 
Scrabble-like lettered tiles. Click and drag the mouse through 
adjacent letters to make words.


Without clicking, simply moving the mouse through the tiles 
(fields) triggers mouseenter, mouseleave, etc. which makes it 
easy to pick up the letters.


But when the mouse is down, it seems mouseloc() is the only thing 
I can get. Using a variable what has all the field rectangles, I 
can use the mouseloc() to ultimately identify the field under the 
pointer, but it's too slow...


Does a moving mouse with the button down trigger any other 
messages besides mouseloc()?


Thanks,

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Cancelling a script??

2017-02-10 Thread Tim Selander via use-livecode

Mike, that did the trick. I'll get into the same coding habit.

Thanks!

Tim Selander
Tokyo, Japan

On 2017.02.11, 0:09, Mike Bonner via use-livecode wrote:

If the loop is tight enough, the keypress never gets through.  I've just
got into the habit of putting an escape hatch into loops that can go wrong.
Something like:
if the environment is "development" and the shiftkey is down then exit to
top
(or if you want the user to have access to the same exit, don't check for
the environment)

Then all you have to do is hold shift and the loop will exit.

On Fri, Feb 10, 2017 at 8:00 AM, Tim Selander via use-livecode <
use-livecode@lists.runrev.com> wrote:


The documentation says Cmd + . should stop a running script.

I haveset the allowinterrupts to true  in my openstack script. But if
I get into a long repeat loop, cmd + . does not stop anything.

Community v8.1, OSX 10.9.

Any advice appreciated.

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Cancelling a script??

2017-02-10 Thread Tim Selander via use-livecode

The documentation says Cmd + . should stop a running script.

I haveset the allowinterrupts to true  in my openstack 
script. But if I get into a long repeat loop, cmd + . does not 
stop anything.


Community v8.1, OSX 10.9.

Any advice appreciated.

Tim Selander
Tokyo, Japan

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Using LC server to check for existence of mp3 on our web server?

2017-01-22 Thread Tim Selander via use-livecode
Phil and Mike, Thanks for your pointers -- both look like they 
will work. Also in continuing to poke around the web, I also 
found this function that works:


function qrtHTTP_FileExists pURL
breakpoint
  local tSocket, tPath, tHeaders, tCommand
  set the itemDelimiter to "/"
  -- extract host IP address and file path from the URL
  put item 3 of pURL into tHost
  if tHost contains ":" then
put tHost into tSocket
  else
put tHost & ":80" into tSocket
  end if
  put "/" & item 4 to -1 of pURL into tPath
  -- build the command
  put "HEAD" && tPath && "HTTP/1.1" into tCommand
  -- build the http headers
  put "Connection: Close" & CRLF & \
  "Host:" && tHost & CRLF & \
  "User-Agent: Revolution (" & the version & ")" into tHeaders
  -- open the socket, write he request and read the response
  open socket tSocket
  write tCommand & CRLF & tHeaders & CRLF & CRLF to socket tSocket
  read from socket tSocket until CRLF
  put word 2 of it into tResultCode
  close socket tSocket
  -- return our interpretation of the result code
  return (tResultCode = 200)
end qrtHTTP_FileExists

It's working for me but now I can't re-find it so I can't 
credit whoever wrote it!


Copying here for posterity!

Tim Selander
Tokyo, Japan


On 2017.01.22, 19:09, Mike Bonner via use-livecode wrote:

If you have php on your second server, and don't have lc, you can do a
check with php similar to what you're talking about.  This is untested but..

If you have the following php file (perhaps named checkforfile.php) on the
alternate server, and send it a get request containing the path to the file
youre looking for, it will return true or false if it exists.  This is
obviously an extremely bare example.  You'd want to make sure the get
contains "myfile" and handle that too, as well as any other issues.   In
addition, you would probably want to limit the requests to only allowed
areas and file types in the php script.



From the lc side of things you could do something like this..


http://your.alternateserver.com/checkforfile.php?myfile=theFile.mp3;
if it is true then
   put "http://my.programserver.com/theFile.mp3>"
   else
   put "program not found."
   end if
?>

Of course if you DO have lc on the program server you can do the same type
of check and "put" true or false just like you did with php.  (Also can be
done with javascript, asp, etc)
On Sun, Jan 22, 2017 at 2:16 AM, Phil Davis via use-livecode <
use-livecode@lists.runrev.com> wrote:


Hi Tim,

Here is a very simplistic way of checking for a file on your server. It
assumes your mp3 files are in a 'programs' folder that resides in the
'document root' folder. This script as it is here would be in a .lc file on
your server. You pass it a filename in the url and it tells you if the file
is in the programs folder or not.

So the url would look something like this:

http://my.programserver.com/check.lc?1234.mp3


The text of the 'check.lc' file:






This is most likely not exactly what you need, but maybe it'll give you a
starting point.

Thanks -
Phil Davis



On 1/21/17 11:36 PM, Tim Selander via use-livecode wrote:


Hi,

On-rev.com hosting, using LC server to present a list of our AM/FM radio
programs for people to listening to on-demand.

Out of a month's 20 programs, 3 or 4 might not get uploaded due to
copyright issues, etc. Also, mp3's are not on the on-rev.com server, but
another hosting service we use as well.

Filenaming is standardized, so I know the list of programs. I want to hit
the server, if the mp3 files exists, present it as an http://lists.runrev.com/mailman/listinfo/use-livecode



--
Phil Davis


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Using LC server to check for existence of mp3 on our web server?

2017-01-21 Thread Tim Selander via use-livecode

Hi,

On-rev.com hosting, using LC server to present a list of our 
AM/FM radio programs for people to listening to on-demand.


Out of a month's 20 programs, 3 or 4 might not get uploaded due 
to copyright issues, etc. Also, mp3's are not on the on-rev.com 
server, but another hosting service we use as well.


Filenaming is standardized, so I know the list of programs. I 
want to hit the server, if the mp3 files exists, present it as an 
program not available" message.


If I wanted to check on the existence of a small text file, it 
would be fast enough for me to just get it, put it into a 
variable and see if the variable has anything in it. But mp3's 
are too big, so too slow.


Locally, I would simply write "if there is a file 'filename'..." 
 -- what's the equivalent command for checking on existence of a 
file on a server?


Thanks in advance.

Tim Selander
Tokyo, Japan







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode