Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: String array comparison Pin
jsc421-Feb-11 0:13
professionaljsc421-Feb-11 0:13 
QuestionRe: String array comparison Pin
David Crow1-Feb-11 8:51
David Crow1-Feb-11 8:51 
AnswerRe: String array comparison Pin
jsc421-Feb-11 23:36
professionaljsc421-Feb-11 23:36 
AnswerRe: String array comparison Pin
Niklas L31-Jan-11 12:31
Niklas L31-Jan-11 12:31 
GeneralRe: String array comparison Pin
jharn31-Jan-11 12:41
jharn31-Jan-11 12:41 
GeneralRe: String array comparison Pin
KP Lee1-Feb-11 2:22
KP Lee1-Feb-11 2:22 
GeneralRe: String array comparison Pin
jharn1-Feb-11 4:39
jharn1-Feb-11 4:39 
GeneralRe: String array comparison Pin
jharn1-Feb-11 5:04
jharn1-Feb-11 5:04 
This is the VBA code I was trying to translate from, it is a bit cleaner since I am a bit more familiar with it. Just posting so you can see what I was trying to do.

Function HEI_F2(ByVal typ As Variant, bwg As Integer) As Double 'saturation pressure inHg from Temp
Dim vl_reg1 As Variant, vl_reg2 As Variant, vl_reg3 As Variant, vl_reg12 As Variant
Dim vl_reg14 As Variant, vl_reg16 As Variant, vl_reg18 As Variant, vl_reg20 As Variant
Dim vl_reg22 As Variant, vl_reg23 As Variant, vl_reg24 As Variant, vl_reg25 As Variant
Dim tp As Integer
vl_reg1 = Array("70-30 Cu-Ni", "90-10 Cu-Ni", "Admiralty Metal", "Aluminum Brass", "Aluminum Bronze", _
"Arsenical Copper", "Cold-Rolled Low Carbon Steel", "Copper Iron 194 (Olin 194)", _
"Titanium Grades 1 & 2", "304 SS", "316/317 SS", _
"N08367 (AL6XN)", "S43035 (TP439)", "S44660 (Sea-Cure)", "S44735 (AL29-4C)")

vl_reg2 = Array(12, 14, 16, 18, 20, 22, 23, 24, 25)


vl_reg12 = Array(0.71, 0.8, 0.93, 0.92, 0.89, 0.98, 0.81, 1#, 0.64, 0.54, 0.53, 0.48, 0.63, 0.58, 0.58)
vl_reg14 = Array(0.78, 0.85, 0.96, 0.95, 0.93, 1#, 0.86, 1.01, 0.71, 0.62, 0.61, 0.56, 0.71, 0.66, 0.66)
vl_reg16 = Array(0.83, 0.89, 0.98, 0.97, 0.96, 1.01, 0.9, 1.02, 0.77, 0.69, 0.67, 0.63, 0.77, 0.72, 0.72)
vl_reg18 = Array(0.88, 0.93, 1#, 0.99, 0.98, 1.02, 0.94, 1.03, 0.83, 0.75, 0.74, 0.7, 0.82, 0.79, 0.79)
vl_reg20 = Array(0.92, 0.96, 1.01, 1.01, 1#, 1.03, 0.97, 1.03, 0.89, 0.82, 0.81, 0.78, 0.88, 0.85, 0.85)
vl_reg22 = Array(0.95, 0.98, 1.02, 1.02, 1.01, 1.03, 0.98, 1.04, 0.91, 0.86, 0.85, 0.82, 0.91, 0.89, 0.89)
vl_reg23 = Array(0.96, 0.99, 1.02, 1.02, 1.01, 1.04, 0.99, 1.04, 0.93, 0.88, 0.87, 0.84, 0.92, 0.9, 0.9)
vl_reg24 = Array(0.97, 0.99, 1.03, 1.02, 1.02, 1.04, 1#, 1.04, 0.94, 0.9, 0.89, 0.86, 0.94, 0.92, 0.92)
vl_reg25 = Array(0.97, 1#, 1.03, 1.03, 1.02, 1.04, 1#, 1.04, 0.95, 0.91, 0.9, 0.88, 0.95, 0.93, 0.93)
vl_reg3 = Array(vl_reg12, vl_reg14, vl_reg16, vl_reg18, vl_reg20, vl_reg22, vl_reg23, vl_reg24, vl_reg25)

counter = 0
Do While counter <= UBound(vl_reg1)
If typ = vl_reg1(counter) Then
tp = counter
Exit Do
End If
counter = counter + 1
Loop

counter = 0
Do While counter <= UBound(vl_reg2)
If bwg = vl_reg2(counter) Then
bg = counter
Exit Do
End If
counter = counter + 1
Loop
HEI_F2 = (vl_reg3(bg)(tp))
End Function
GeneralRe: String array comparison Pin
KP Lee1-Feb-11 10:18
KP Lee1-Feb-11 10:18 
GeneralRe: String array comparison Pin
jharn1-Feb-11 10:40
jharn1-Feb-11 10:40 
GeneralRe: String array comparison Pin
jharn1-Feb-11 10:46
jharn1-Feb-11 10:46 
GeneralRe: String array comparison Pin
KP Lee1-Feb-11 14:00
KP Lee1-Feb-11 14:00 
AnswerRe: String array comparison [modified] Pin
Alain Rist2-Feb-11 7:07
Alain Rist2-Feb-11 7:07 
GeneralRe: String array comparison Pin
jharn2-Feb-11 14:45
jharn2-Feb-11 14:45 
GeneralRe: String array comparison Pin
Alain Rist2-Feb-11 20:30
Alain Rist2-Feb-11 20:30 
GeneralRe: String array comparison Pin
Alain Rist2-Feb-11 22:54
Alain Rist2-Feb-11 22:54 
GeneralRe: String array comparison Pin
jharn3-Feb-11 5:46
jharn3-Feb-11 5:46 
GeneralRe: String array comparison Pin
Alain Rist3-Feb-11 9:39
Alain Rist3-Feb-11 9:39 
AnswerRe: String array comparison Pin
Stuart Rubin1-Feb-11 3:22
Stuart Rubin1-Feb-11 3:22 
AnswerRe: String array comparison Pin
thomas.michaud1-Feb-11 5:57
thomas.michaud1-Feb-11 5:57 
AnswerRe: String array comparison Pin
MarvinMartian1-Feb-11 13:47
MarvinMartian1-Feb-11 13:47 
QuestionReadFile() Problem Pin
goldenrose931-Jan-11 4:12
goldenrose931-Jan-11 4:12 
AnswerRe: ReadFile() Problem Pin
David Crow31-Jan-11 4:18
David Crow31-Jan-11 4:18 
GeneralRe: ReadFile() Problem Pin
goldenrose931-Jan-11 4:32
goldenrose931-Jan-11 4:32 
AnswerRe: ReadFile() Problem Pin
David Crow31-Jan-11 4:44
David Crow31-Jan-11 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.