Wrox Programmer Forums
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 29th, 2008, 02:58 PM
Registered User
 
Join Date: Jul 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ArcGIS Script Help

I am an ArcGIS user and I need to implement the following code into an Event Handler for ArcPad 7.1 (SQL Compact Edition database on Windows Mobile v5.0 platform). I can provide the ArcPad object model diagram if necessary.
I am getting a Syntax error:(800A03EA- Line 2 Column 3
                            (Source Text Unavailable
                            (Sub InitializeForm
Code:
InitializeForm ReturnNextID
  Sub InitializeForm
    Dim objEditForm, objEFP1Ctrl 'Reference custom form and control
    Set objEditForm = ThisEvent.Object 'Reference event handler object
      If Not objEditForm.Mode = 3 Then 'Force form's Edit mode
         Exit Sub
      End If
    Set objEFP1Ctrl = EditForm.Pages("PAGE1").Controls 'Ref control
        objEFP1Ctrl.Enabled = False 'Disable user input to control
    Dim objOutfallsRS
    Set objOutfallsRS = Layer.Records 'Ref record set
        objEFP1Ctrl("OUTFALL_ID").Value = ReturnNextID (objOutfallsRS, "OUTFALL_ID") 'Set control value 'to Function return value
    Set objEFP1Ctrl = Nothing 'Free objects
    Set objEditForm = Nothing
    Set objOutfallsRS = Nothing
  End Sub

  Function ReturnNextID(objOutfallsRS, strFieldName)
    Dim intMaxVal
      objOutfallsRS.MoveFirst 'Move to first record
      intMaxVal = CInt(objOutfallsRS.Fields(strFieldName).Value) 'Set
    'max value
    Dim intCurrVal
    While Not objOutfallsRS.EOF 'Loop to find\update max value
      intCurrVal = CInt(objOutfallsRS.Fields(strFieldName).Value)
        If (intCurrVal > intMaxVal) Then
           intMaxVal = intCurrVal
        End If
     objOutfallsRS.MoveNext
    Wend
    ReturnNextID = CStr(intMaxVal + 1) 'Add 1 and coerce string
  End Function
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Script Help :) zere0 VBScript 6 December 7th, 2004 02:23 PM
looking for script 7474information Classic ASP Basics 4 October 22nd, 2004 02:48 AM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.