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)

7
votes
2answers
552 views

Parsing serial date in ArcGIS for Desktop?

I have imported a shapefile that contains a serial date number that looks like this: 41256.260799. I would like to create a new field that shows only the hour and second like this: 06:33. I've tried ...
2
votes
1answer
38 views

Inserting substring in ArcGIS Field Calculator

Trying to use the split tool in ARCGIS to add an underscore. Trying to make "ABC11111" look like "ABC_11111". Don't have much experience using Python or VB Script but this is what I have created with ...
1
vote
1answer
31 views

VBScript, Error 999999 Syntax Error Calculate Field in ArcGIS

I am using a field [all scores] as a parameter agricultural classification. I tried using field calculator (VB script) with many kinds script, but it never works and giving me notification 99999, ...
1
vote
1answer
64 views

Labeling with two decimal places (rounded) even when second is zero in ArcMap?

I have a benchmark data that need to label. The data where in the field has attribute height like 12.340, 12.400, 13.690. I have to label the height for examples 12.34, 12.40, 13.69.I already used ...
2
votes
1answer
103 views

Populating attribute table string field with values from long field using vbScript in ArcGIS Field Calculator?

I want to calculate the field "area_type" with text depending on numbers from the "Value" field. I have tried with the following VB-script in "Field Calculator" but am getting this error message: ...
2
votes
2answers
130 views

Troubleshooting VBScript for labeling in ArcMap?

I am trying to add FIPS codes to my county name labels and want to add either one or two zeros to the number unless it is over 100. i'm hoping someone can find the error in my code: Function ...
3
votes
2answers
40 views

Using Field Calculator vb to check for name with /n in the string?

I am calculating values for a field (Score) based upon the names from another field (Modified). One name is "blaugh\nblaugh". Field Calculator keeps treating the name as having a new line command. I ...
0
votes
1answer
94 views

Maplex issues with “vbnewline” in ArcMap

I'm trying to stack labels using an expression I wrote using VBScript. I can get them to stack using "vbnewline" but it is a no go when using Maplex's label stacking options. Using ArcGIS for ...
1
vote
1answer
118 views

VB Script can't run in Field Calculator

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot.
3
votes
2answers
62 views

Why is VBS If Then Label Expression not working?

I am trying to label a field based on other field. For [TYPE] = "PRIMARY", the [LABEL] is having this structure: "TAN80901B" For [TYPE] = "SECONDARY", the [LABEL] is like this: "TAN80901C/D20b" I ...
2
votes
4answers
1k views

VBScript - If/Then Statement - Field Calculator

I am trying to do a simple (or so I thought) if/then statement in the ArcGIS field calculator. I am trying to add the HydroCode field - hydologic soil codes - to an existing data set. I know what the ...
3
votes
2answers
66 views

VBscript to not include empty fields

I am trying to create a label in arcgis with about 30 columns with this basic VBscript: [field1] & vbnewline & [field2] & vbnewline &[field3] & vbnewline... ETC How can I make ...
1
vote
1answer
58 views

If then else Logical VBScript in ArcMap 10.3.1

I realize this question has been asked in its basic form before, but I've tried a lot of code samples on answers posed to similar questions on this site to no avail. I'd like to create a new field ...
1
vote
1answer
9k views

Find and replace, field calculator

Can someone show me a very simple find and replace in field calculator for just one or two characters in a field based hyperlink?
1
vote
0answers
53 views

Converting Atn function of VB Script for Python parser of ArcGIS Field Calculator? [closed]

I would like to convert the Atn function (which returns the arctangent of a number) of VB Script to Python but I cannot find exactly the same function. Any help? I want to convert the slope of ...
1
vote
0answers
318 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 ...
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 ...
2
votes
2answers
72 views

type mismatch: 'esri_8' when using field calculator

I am trying to run the VBScript 'round' function using the field calculator on a column for a numeric field that contains a large number of rows (> 500k). When I run the code on a subset of the field ...
2
votes
1answer
111 views

Using ArcMap Field Calculator to count number of identical values?

I have a file with an attribute table with data in 3 columns, and would like to use field calculator to populate a 4th column. The data is integer numbers between 0 and 56. I want the new column to ...
0
votes
0answers
66 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
873 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 ...
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 ...
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 ...
1
vote
2answers
1k views

Adding Values together using FindLabel (VBscript) function of ArcMap Label Expression?

I would like to add values from multiple fields in a shape file and display the result as a label This is what I'm doing currently:: if ( [SwineGesBo] + [SwineSowLt] > 0) then output = ...
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 = ...
1
vote
1answer
52 views

How do I round the coordinates of a point before insert into attribute table in ArcGIS?

Until now I doing the following steps to get rounded coordinates: create a new x and y column in the attribute table use Calculate Geometry round the column value with the Field Calculator using VBS ...
0
votes
1answer
65 views

What expression needed for universal naming of parts polygon feature class?

For example, i have n count of polygons and little parts of it. I want in field [Name] get string: "PNum1(1)". where "1" - number of main polygon [Num], "(1)" - number of part of main polygon ...
2
votes
2answers
197 views

Randomly choosing one from multiple fields in Field Calculator of ArcGIS for Desktop?

Using the Field Calculator in ArcGIS for Desktop, I want to randomly choose one field from a list of 10 fields (strings). The Excel equivalent, which is working, is: =INDEX(A2:J2;rnd()*10+1). How ...
3
votes
2answers
223 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
2answers
86 views

Using ArcGIS Desktop field calculator (python) to parse date

I'm trying to parse a datetime field using python (but have never used python for it before). I have a field that contains a valid date, but not a valid time... and other fields that have valid hour ...
3
votes
2answers
163 views

Calculate QUARTER from Date field using ArcGIS Field Calculator?

I currently have a Date field in the format of MM/DD/YYYY. My goal here is to convert the Dates into 1 of 4 quarters, along with the Year. The field to be created will be called QTR_YR. My first ...
0
votes
1answer
55 views

calculate specific rows and populate their result in another field

I'm working on ArcGIS 10 desktop version. I have a file with one entity entered multiple times (rows) and each time that has been given a new value against it. I want to sum the values against this ...
2
votes
1answer
72 views

Selecting numbers within the slash (/) using ArcMap Field Calculator?

I have date data that I'm separating into three separate fields (all fields are string type, including the input field) by day, month, and year. Unfortunately, the date field is raw data and isn't ...
0
votes
0answers
52 views

Concatenation of fields with if or when circumstances

I have a field named PROJECT_DESCRIPTION that concatenates the STREET_NAME, FROM and TO fields. Sometimes the FROM or TO fields are only address ranges. In my PROJECT_DESCRIPTION field I would like to ...
1
vote
1answer
89 views

How to add label from header field name in ArcMap

I have some fields which contain numbers, when I added them as labels, it shows on the map as numbers. Is there any way to add header name of the field with the number?
0
votes
0answers
24 views

Using ArcGIS field calculator to rank continuous field within shapefile using VBscript parser? [duplicate]

So have been trying to get the VBscript code below to work in the ArcGIS field calculator. The values are a continuous set of data between 15-88, and I have used the natural breaks jenks rank to rank ...
2
votes
2answers
45 views

ArcPad 10.2 Command bar & Quick Access Menu

I am interested in making the Quick Access menu and Command Bar not available/visible for my users. The Quick Access Menu is prompted by the little icon on the bottom right of the tab bar seen here: ...
2
votes
0answers
146 views

ArcMap Label Help - Label from X/Y Coordinate

Edited: This picture might help explain my question. Here I have a point at the line with an X/Y coordinate. It also has a leader line to it. This leader line has an X2/Y2 coordinate. Both of ...
0
votes
1answer
161 views

Changing Date Format via Field Calculator of ArcMap?

I'm trying to find a function in the Field Calculator (preferably in VB Script) that can add numbers into a field that already has data. I have year data ranging from the 1960s to 2014 in string ...
1
vote
2answers
183 views

using field calculator on string field that has some empty values?

I have a CityState field that has the city and states of landowners. Bellingham WA, for example. I am making two new fields, OwnerCity and OwnerState in which I strip the last two characters of ...
0
votes
1answer
71 views

How do I move the last two characters of a column within the attribute table to another column?

I have data in a column that looks like the below example: El Monte CA I need to move the last 2 characters to a separate column. Which function in the field calculator will deliver those results?
0
votes
0answers
412 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; ...
0
votes
0answers
161 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
1answer
43 views

How to supress 'Start With' Menu in ArcPad 10.2?

I am fairly new to ArcPad in general and I am attempting to suppress the start with menu as seen in the attached photo. I have a script that is called in the event: onstartup, that loads the .APM I ...
1
vote
1answer
91 views

Using label expression to label highway with last group of numbers in field

I'm using Tiger road files and I want to label the highways with their shield number. Tiger has an inconsistent naming convention for road features; I am specifically concerned with the highways. I ...
1
vote
1answer
105 views

VB Script case statment syntax for the field calculator in ArcGIS 10.2?

Can anybody help me with this VB Script code for the field calculator in ArcGIS 10.2? Why in the final result are all the values 10? a= 10 Select Case UCase( [PRIORITY] ) Case "AUX 1": a = 22.5 ...
0
votes
0answers
30 views

Implementation of script for bus waiting stops

I've tried to add waiting time in bus stops in several ways (elevation fields, sub-segments, etc), but nothing worked. I'm now trying to use this script I've found in Internet: if (SourceID of ...
3
votes
3answers
826 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
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 ...
1
vote
1answer
71 views

extract substring after first number

Suppose I have a field titled NAME1. Examples of what is in the field appear like this: Fox Lake 1 WABASCA 166 TSU TUE 196G YELLOW QUILL I.R. 90-8 POUNDMAKER INDIAN RESERVE NO. 114-17 CROSS LAKE ...