View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
Can you please be more specific?  VFP arrays are used by fwx scripts on the server, while JavaScript code runs on the browser.  Are you trying to generate JavaScript code on the fly and you want to populate an array with the contents of a VFP array?  If yes, you can do something like the following in your fwx script:
 
<script language="javascript">
var myJSArray = new Array();
var curRow = 0;
<%FOR i = 1 TO ALEN(myVFPArray)%>
myJSArray(curRow++) = '<%=myVFPArray(i)%>';
<%NEXT%>
</script>
 
The resulting code will be:
 
<script language="javascript">
var myJSArray = new Array();
var curRow = 0;
myJSArray(curRow++) = 'apple';
myJSArray(curRow++) = 'orange';
myJSArray(curRow++) = 'banana';
</script>
 
Obviously if you are dealing with multi-dimentional arrays you will need to adjust the above code accordingly.
 
FoxWeb Support Team
support@foxweb.com
Sent by Sunil Shah on 04/23/2002 02:17:39 AM:

Can I mix javascript arrays functionality with visual foxpro arrays functionality ?

Any examples I can look at ?

TIA

Sunil Shah