View Full Version : VB structure V's LUA table
RizlaUK
04-11-2008, 02:43 PM
ok, im a little confused....again
how would i enumerate a VB structure in AMS
am i right in assuming that
this in VB
Enum CONST_DSFXDISTORTION_GAIN
DSFXDISTORTION_GAIN_MAX = 0
DSFXDISTORTION_GAIN_MIN = -60
End Enum
in AMS would be
CONST_DSFXDISTORTION_GAIN={}
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MAX = 0
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MIN = -60
all this stuff is new to me, but im determind to get to grips with it
Dermot
04-11-2008, 03:39 PM
I believe that would be correct. I would probaly shorten the names though. That's a lot of typing to access a value.
RizlaUK
04-11-2008, 03:58 PM
ah, ok (pats self on the back) i got that bit nailed then
i will proberly wrap it in functions to save some typeing, there are 50+ structures in this ocx so i will need some sort of system
something like this should work
function SetDSFXDistortionGain(nMin,nMax)
CONST_DSFXDISTORTION_GAIN={}
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MIN= nMin
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MAX= nMax
return CONST_DSFXDISTORTION_GAIN
end
SetDSFXDistortionGain(-60,0)
well, time to put it to the test then, thanks again Dermot
ShadowUK
04-11-2008, 04:10 PM
ah, ok (pats self on the back) i got that bit nailed then
i will proberly wrap it in functions to save some typeing, there are 50+ structures in this ocx so i will need some sort of system
something like this should work
function SetDSFXDistortionGain(nMin,nMax)
CONST_DSFXDISTORTION_GAIN={}
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MIN= nMin
CONST_DSFXDISTORTION_GAIN.DSFXDISTORTION_GAIN_MAX= nMax
return CONST_DSFXDISTORTION_GAIN
end
SetDSFXDistortionGain(-60,0)
well, time to put it to the test then, thanks again Dermot
function SetDSFXDistortionGain(nMin,nMax)
return {DSFXDISTORTION_GAIN_MIN = nMin, DSFXDISTORTION_GAIN_MAX = nMax}
end
Also your table is global, if you're gonna return a table like that, local it first.
RizlaUK
04-11-2008, 05:04 PM
good point :yes
that was just a example to make sure i know what im doing when it comes to adding the code to my project.......just kinda making a road map at the min as im undecided about a few things
this project im planning is huge, or will be, so im going to need to plan it right from the get-go else months of waisted time, hence the barrage of question, lol
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.