hexagon logo

Visual Basic Hexagon course help!!!

I'm probably going to feel really stupid because there is probably a simple answer that I'm just not seeing. I'm doing the VB Net online course from Hexagon and I need to add an "Or" operator. The course doesn't tell me how to do it, Google has been no help and I can't find anything in Visual Basic. I'm needing to add the one in the teal box circled in red. Please help so I can quit banging my head on the desk.

I know you are good with this stuff...

Parents
  • If anyone knowledgeable with Visual Basic C# programming has some extra time, could you try this code out and see if you are getting the same error?

    I'm curious to see if others get the same error. If I am doing it right and there is an error, Hexagon needs to update the training.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace ParemetricProgramLoader
    {
    class Program
    {
    static void Main()
    {
    Console.WriteLine("Enter part number:");
    var partName = Console.ReadLine();
    
    var partFilePath = $@"C:\Users\insp\Desktop\CMM PROGRAMS\VB TEMP\{partName}.txt";
    
    var partParameters = File.ReadAllLines(partFilePath)
    .Select(p => p.Split(','))
    .ToDictionary(p => p[0], p => p[1]);
    
    var pcdmisType = Type.GetTypeFromProgID("PCDLRN.Application");
    var pcdmis = Activator.CreateInstance(pcdmisType) as PCDLRN.Application;
    var program = pcdmis.ActivePartProgram;
    var commands = program.Commands;
    for (int i = 1; i <= commands.Count; i++)
    {
    var command = commands.Item(i);
    if (command.IsFlowControl)
    {
    var assignmentCommand = command.FlowControlCommand;
    var assignmentName = assignmentCommand.GetLeftSideOfExpression();
    var parameterExists = partParameters.TryGetValue(assignmentName, out string assignmentValue);
    if (parameterExists)
    assignmentCommand.SetRightSideOfAssignment(assignm entValue);
    }
    }
    }
    }
    }
  • Try adding

    using System.IO;


    to the uses clause.
Reply Children
No Data