VBScript (Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft that is modeled on Visual Basic.

learn more… | top users | synonyms (1)

4
votes
1answer
6k views

Field Calculator VB Script Codeblock IF statement syntax is wrong?

I can't figure out why the syntax is wrong in Field Calculator ArcMap 10. The complete codeblock is Dim CapitalDia As Number Dim TwagDia As Number Dim X As Number CapitalDia = [New_Pipe_S] TwagDia =...
2
votes
1answer
359 views

ArcPad get vbs script location

Within arcpad (edit form) I want to get the current location of the vbs script running. This simple vbs script outside of arcpad works fine. wscript.echo " " + Wscript.ScriptFullName However, when ...
3
votes
3answers
845 views

How to make Field Value constant size (length) by appending zeros towards end?

How do I append my field values in my .dbf to correspond with the values of my feature's attribute table. I need to append 0's to the field value if the field value is less than 11 characters in ...
4
votes
4answers
4k views

How to concatenate numbers and add in leading zeros?

I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01. Getting to 1.9.1 is easy but can anyone help out with how to formulate it so ...
2
votes
1answer
3k views

How to combine If Then with InStr in ArcMap field calculator?

I want to write an if then in field calculator that tests if a field in the attribute table contains one of several versions of another string (the versions vary by capitalization). Trouble is, I can'...
4
votes
2answers
8k views

Remove first n characters in label using ArcGIS 10 label expression builder with VBscript

I have a planning cadastre dataset. It has the type of plan (DP, RP or SP) and then the plan number, thusly: DP123456 RP1248590000 SP3855 etc... I want to make a label in the expression builder in ...
1
vote
2answers
2k views

ArcGIS field calculator: VBScript get data from previous row

When using the field calculator, how do I get data from the previous row in VBScript? In Python I'd do something like this: for index, row in enumerate(rows,start=1): row[index-1] += 5 I'm ...
3
votes
1answer
1k views

VBscript Regular Expression in ArcMap Field Calculator

I'm looking for a regex in VBscript that I can use on a ArcMap table. I know what it would look like in python: pat =r'[0-9]{3,4}' This filters all numeric characters from the string which have the ...
7
votes
1answer
1k views

ArcMap 10: How do I escape certain characters when labeling?

I am labeling certain Oil & Gas areas by Operator in ArcMap 10, using this expression: "" & [OPERATOR] & "" & vbNewline & "" & [UNIT_NAME] & "" The only problem is ...
1
vote
3answers
3k views

Using VBScript to label shapefile in ArcMap?

If you're reading this for the first time, it might be best to focus on section beneath ANOTHER UPDATE. I'm a beginner with VBScript and I have a question about using an VBScript expression for a ...
0
votes
1answer
121 views

create geometry in arcpad

i want to create a point geometry in ArcPad 10 VBScript, to make custom feature drawing. so i want create point geometry then record.shape = point or records.AddNew(point) i want to create ...
3
votes
2answers
224 views

Updating new field from existing field using ArcGIS Desktop?

I need to update my new field/column (Property Type) with either "detached", "semi", or "terrace" depending on an existing column (Property Count): where the count = 1 I need to populate Property ...
3
votes
1answer
806 views

ArcPad 10 Studio, from form to vbscript back to form

There is very little documentation on using vbscript within a form. Any help with syntax for ArcPad 10 would be appreciated. Within my subroutine, I want to grab some numerical data entered in a ...
2
votes
1answer
1k views

Programatically write values to ArcPad Form control box

Using this blog post I've managed to store user names as global variables in ArcPad. The next step is to use those variables in form 'controls' aka form fields. Per the author's comments under his ...
1
vote
1answer
2k views

ARCPAD - VBscript to update values in attribute table

I am working on an automating tool for ArcPad for inventory issues on our mobile GIS machine (Trimble GeoXH - Geoexplorer 2008 series - Windows mobile 6.1 and Arcdap 10.0.3). I have developed the ...
3
votes
2answers
8k views

Using conditional statements in Field Calculator

I have two fields, "P_Area" and "PC_Area", whose sizes I'd like to compare in a third field, "Areas_Equal". The "Areas_Equal" field should contain a "Yes" if the other two are equal and a "No" if they ...
0
votes
4answers
400 views

How to solve a run-time error in Thiessen polygons command line

Well I revise my post by giving more information for my problem hoping I may get some help please. I call Procedure 2 from a loop that is within Procedure 1 (see below). The program stacks in the ...
1
vote
0answers
228 views

How can I denote the values of reclassification using variables?

I used the following lines of code to classify a raster. However, my problem is how can I denote the old and new classification values in the last code line using variables? Then number of values ...
1
vote
0answers
323 views

Extract by mask run time error in VBA

I have the following script language code shown below within a main code just to run the tool of spatial analyst "Extract by mask". Unfortunately, when I run it I get a Run Time Error. I checked file ...
2
votes
0answers
110 views

How can I identify the pixel with the maximum value in a grid? [duplicate]

Possible Duplicate: How to find the locations of the highest values in a raster? How can I identify the pixel with the maximum value in a grid and get its coordinates? Any VBA code please?
14
votes
2answers
4k views

How can I create weighted Thiessen polygons?

I have a point shape file and I create Thiessen (Voronoi) polygons programmatically using this scripting syntax: CreateThiessenPolygons_analysis (in_features, out_feature_class, fields_to_copy) ...
4
votes
2answers
6k views

Nested “if” statements in ArcGIS Field Calculator

The solution in VB for the base process is @ "If then" VB Script code (or Python) equivalent to SQL's IN ('x','y',z') expression in ArcGIS Field Calculator question? ...
3
votes
2answers
1k views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
4
votes
1answer
2k views

Running VB scripts in ArcGIS Desktop?

Some questions about VB scripts: Can I read and modify the code of a VB script? If the answer is yes, how can I do it? How can I run a VB script? Can I use it as a VBA code eg.using variables ...
0
votes
0answers
164 views

Is there any way to fix the position of fixed buttonpads in the top toolbar in MapBasic?

Here is my code to create some buttons: Include "icons.def" Declare Sub Main Declare Sub button_prompt Sub Main Create ButtonPad "Providers" As PushButton Icon MI_ICON_ZOOM_QUESTION Calling ...
0
votes
0answers
67 views

Wrong location with result of VBscripting in ModelBuilder?

I run ModelBuilder program's VBScript. The results I receive is like the original input coordinates but when I export to the arcmap the distance between results and origin map is about 5000 km. How ...
0
votes
1answer
885 views

Using VBscript in ModelBuilder?

I use the ModelBuilder to run my model and I have question Sub M() ' Create the Geoprocessor object Dim gp As Object Set gp = CreateObject("esriGeoprocessing.GPDispatch.1") ' Check out any ...
0
votes
0answers
416 views

Adding a polygon in ArcGlobe via GraphicsContainer.AddElement

I'm trying to add some data to an ArcGlobe; however, it's not showing up and I'm wondering what the issue is. I am doing the following: IGeometry geometry; Ipolygon polygon = myPolygon; polygon....
4
votes
2answers
6k views

If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?

we need just like the following, only with multiple records selected... have tried the "xyz" in (1,2,3,4,5) SQL code but of course VB Script wants something else. dim f2 if [field1] = "foo" then f2 ...
1
vote
1answer
4k views

Concatenating fields using VBscript in ArcGIS Field Calculator?

I'm trying to get one column of text to move into another column that already has text. I DON'T want to replace it, I want the transferring text to be added to the already existing text in a shp file ...
4
votes
1answer
1k views

VB scripting in ArcGIS Field Calculator?

In my attribute tables field I am trying to get rid of the "&" in between names i.e. "John Adams & wife" and want it to say "John Adams and Wife" in all the attributes with "&". What is ...
6
votes
3answers
6k views

Field Calculator syntax?

I can't get the syntax correct for a fairly simple if statement. Right now it looks like this: dim Output as Integer If [HECTARES] >= 30 AND [HEIGHT] >= 17 AND [CROWN] >= 59 THEN Output = ...