LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-18-2005, 09:12 AM   #1
mrobertson
Member
 
Registered: May 2005
Posts: 275

Rep: Reputation: 30
building a three dimensional array in vb6


I am trying to make a change to to an old application in which a three dimensional array was hard coded as follows:

GC(1, 1, 1) = 0.059
GC(2, 1, 1) = 0.059
GC(3, 1, 1) = 0.059......etc

Here is the old code that initialized each value:

Code:
Private Function lowestgauge(width As Double, thickness As Double, grade As String) As Double
Dim wrt As Integer
Dim increment As Integer
Dim srt As Integer
Dim grt As Integer
Dim inch As Integer

Item = adoSchdRs.Fields(0)
coil_id = adoSchdRs.Fields(7)
'get the width range number from the lookup table
   width = adoSchdRs.Fields(9)
   increment = 1
   inch = 30
   Do Until inch <= width And width < (inch + 1)
    inch = inch + 1
    increment = increment + 1
    wrt = increment
   Loop
'end of get the width range number from the lookup table
 
'next get the thickness number
   thickness = adoSchdRs.Fields(2)
   Select Case thickness
    Case Is < 8
     srt = 1
    Case Is >= 8
     srt = 2
   End Select
'end get the thickness number
    
'lastly we need the grade lookup number
    grade = adoSchdRs.Fields(6)
    Select Case grade
     Case 1005 To 1008, "0409", "MLS1", "MLS2", "MLS3"
      grt = 1
     Case 1010 To 1015, 1211
     grt = 2
     Case "1P10", "1P12"
      grt = 2
     Case 1016 To 1020
      grt = 3
     Case "1P15"
      grt = 3
     Case 1021 To 1025
      grt = 4
     Case 1026 To 1040, "1M23", "1B06"
      grt = 5
     Case 1041 To 1065
      grt = 6
     Case 1066 To 1095, 4130
      grt = 7
     Case "0655", "O655", "C655", "409A"
      grt = 8
     Case Else
      grt = 1              'grade wasn't found...use grt=1
    End Select
 'done with grade lookup number
 
 lowestgauge = GC(wrt, srt, grt)

 End Function
Now the data is stored in a text file as follows:

1005-1008 under 8" slab,0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.065, 0.065, 0.065, 0.065, 0.065, 0.07, 0.07, 0.072, 0.076, 0.078, 0.082, 0.085

Can anyone help me as to how I would build the same array that was hard coded by reading this text file?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Two Dimensional Character Problem Mistro116@yahoo.com Programming 8 11-26-2005 08:13 PM
Bash 2 dimensional array ldp Linux - General 5 07-29-2005 11:29 AM
memory managment problem; higher dimensional array doesn't delete qanopus Programming 5 06-15-2005 04:18 PM
3 dimensional array help leeach Programming 11 06-15-2005 10:46 AM
VB6 on Visual Studio? mohbana Programming 1 11-23-2004 01:40 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration