Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help using arrays

Status
Not open for further replies.

sudi123

Programmer
May 8, 2002
20
0
0
US
is there a way to pass an array from a function other than
using the return type as a Variant...

i need to pass an array from an activex exe object to a java script class and i donno why its not taking the values...but when i pass individual variables its taking it correctly

any kind of help is highly appreciated
 
first of all thanx for the help

my vb function is as below which returns a string array

Public Function getParamList(strSource As String) As Variant

'=================== LOCAL VARIABLES ========================
Dim intParamCount, intk As Integer
Dim a As PEParameterFieldInfo
Dim strParam() As Variant

'============ Starts the Print Engine ====================
intResult = PEOpenEngine()

'======= Initialization of the below variables required ==========
a.StructSize = PE_SIZEOF_VARINFO_TYPE

'======== Opens the Print Job given the Path to the Report ==========
intMainJob = PEOpenPrintJob(strSource)

'=====Gets the Number of Parameters for the given Job===========
intParamCount = PEGetNParameterFields(intMainJob)

'==== Redefining the array which fits to the number of parameters
ReDim strParam(intParamCount)

'======= Getting the Name of the Parameter and Assigning the Values to an Array====
For intk = 0 To (intParamCount - 1)
intResult = PEGetNthParameterField(intMainJob, intk, a)
strParam(intk) = a.Name
Next intk

'===== Assigning the Array to the Name of the Function============
getParamList = strParam

'=============== Closing the Print Job==============================
PEClosePrintJob (intMainJob)

'==========Closing the Print Engine =============================
PECloseEngine
End Function


when i use the asp code to retreive the value it does not print anything...

<html>

<script id=&quot;serverMainScript&quot; language=&quot;javascript&quot; implements-prefix=&quot;user&quot; runat=&quot;server&quot;>

a = new Array(1);


var oClass = Server.CreateObject(&quot;ccrpengine.iReport&quot;)


a=oClass.getParamList(&quot;C:\\Inetpub\\
response.Write(a[0]);

</script>

</html>

but when i try to pass a single string rather than array and catch that string in a[0] am able to see the first element but if i do the above way am not able get anything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top