How do I pass a variable from Syntax in VB script to VB and back to Syntax. Here is my code to date.

How do I pass a variable from Syntax in VB script to VB and back to Syntax. Here is my code to date.

Post by jason.dry.. » Thu, 28 Jan 1999 04:00:00



I am trying to use a VB varable inside of a syntax VB string inorder
to keep the value for later use.  If you look at "'Number of Records"
you will see where I have tryed to create a VB string in side of a VB
string ("'+strVaildR+'").  I want to put it back in at the second to
last line of code shown here.

Does anyone have any idea how to pass it back and forth?  Is there a
better way.  You would think just useing "MATCH" would work but one of
my tables can't be made parallel to the other.

My boss says "Just make a pivot table".  That's fine if you can run
some kind of calulation on it and get the pivot table but at present
it can't so I have resorted to calling up each file over and over as
needed.

Any help would be appreciated.

Thanks,

Jason

****************************************************************************

Example:

GetItemFile

        strCommand = "COMPUTE RawScore = "
        strCommand = strCommand + "SUM(itemcorr)." 'itemcorr is added
instead of d1 to d10 of the original syntax script
        objSpssApp.ExecuteCommands strCommand, True

        strCommand = ""

'Number of Records

        strCommand = "COMPUTE '"+strValidR+"' = NVALID(RawScore)."
        objSpssApp.ExecuteCommands strCommand, True

        strCommand = ""

        strCommand = "FREQUENCIES"
        strCommand = strCommand + "        / VARIABLES = ValidR."
        objSpssApp.ExecuteCommands strCommand, True

        strCommand = ""

'Number of Candidates

        GetMasterFile

        'Sorst cases, counts Any that are Not identical.
        strCommand = "SORT CASES BY Candidid ."&vbCrLf

        strCommand = strCommand + "DO IF (Candidid = LAG (Candidid,
1)) ."&vbCrLf
        strCommand = strCommand + "COMPUTE Dupe = 1 ."&vbCrLf
        strCommand = strCommand + "END IF ."&vbCrLf
        strCommand = strCommand + "COUNT Dups = Dupe (1) ."&vbCrLf
        objSpssApp.ExecuteCommands strCommand, True

        strCommand = ""

        strCommand = "COMPUTE NumCands = ('"+strValidR+"' - Dups)."
        objSpssApp.ExecuteCommands strCommand, True

 
 
 

1. Converting VB syntax to VO

How can I use follwing VB syntax in VO 2.0.b4?
I am eveluating Spread 3 OCX-Grid with VO.

**************************
dim ks as variant
ret=vaspread1.gettext(1,1,ks)
**************************

-Kubilay-

From  Spread 3's HelpFile
---------------------------
 GetText Function

Applies To
fpSpread ActiveX and VBX controls

Description
Returns the text of the specified cell.

Syntax

C++ (ActiveX) BOOL CSpreadSheet::GetText (long Col, long Row, VARIANT* Var);
C++ (MFC VBX) CString CSpreadSheet::GetText (long Col, long Row);
C++ (OWL VBX) string CSpreadSheet::GetText (long Col, long Row);
Visual Basic (ActiveX) fpSpread.GetText(ByVal Col As Long, ByVal Row As
Long, Var As Variant) As Boolean

Visual Basic (VBX) Function SpreadGetText(SS As Control, ByVal Col As Long,
ByVal Row As Long, Var As Variant) As Integer

Parameters

The following parameters are available:

Parameter Description
SS fpSpread control name
Col Column number of cell
Row Row number of cell
Var Text in cell
Remarks

Use this function as a more concise way to return data rather than using the
Text property.
Note that if you are returning data from a float or integer cell, this
returns the data as string values. If you want to return the data as
floating-point or integer values, call the GetFloat or GetInteger functions.

Return Type

ActiveX: True if successful; otherwise, False.
VBX: Nonzero if successful; otherwise, 0.

2. Running Stored Queries

3. How to pass an argument from command syntax to a script

4. Shopping: Input req. Inkjet, Laser, or stone & chisel?

5. passing macro from syntax to script

6. Keeping networks separate

7. question about passing a value from syntax to script

8. outlook express 6 crashes

9. Passing parameters from a script to a syntax

10. Passing VB Variables

11. Newbie Question: Creating Dummy Variables (syntax code)

12. PHP syntax highlighting and heredoc syntax

13. syntax errors with vim 5.7 and xml.vim syntax file!