So whats your favourite function or piece of code?
VB6 mine is
VB.NET it has gotta beVB Code:
While .... Wend 'or Split()
VB Code:
String.Empty 'or For i as Integer = 1 to Something
Printable View
So whats your favourite function or piece of code?
VB6 mine is
VB.NET it has gotta beVB Code:
While .... Wend 'or Split()
VB Code:
String.Empty 'or For i as Integer = 1 to Something
vb6:
VB Code:
End
:lol:
Lol. That's a forbidden word around here!!Quote:
Originally Posted by VBlee
It's either:
VB Code:
For mJ = 1 To CELLS_TO_MAJOR_EQS(curFam, 0) mCeq1 = CELLS_TO_MAJOR_EQS(curFam, mJ) MAJOR_EQ_SUMS(mCeq1) = LEV_MAJOR_EQ_SUMS(mLev)(mCeq1) + curVal * MAJOR_FAM_EQS(mCeq1, curFam) Next For mJ = 1 To FAM_TO_FLEV_EQS(curFam)(0) mCeq1 = FAM_TO_FLEV_EQS(curFam)(mJ) FLEV_SUMS_SO_FAR(mCeq1) = LEVED_FLEV_SUMS_SO_FAR(mLev)(mCeq1) + curVal * FLEV_COMPONENT_LIMIT_EQS(mCeq1, curFam) Next For mJ = 2 To FAM_TREE(mLev)(0) varFam = FAM_TREE(mLev)(mJ) FAM_SOL(varFam) = MAJOR_EQ_SUMS(CELLS_TO_MAJOR_EQS(varFam, 1)) If FAM_SOL(varFam) < SUPERFAM_LOWLIMITS(varFam) Then kGoing = False Exit For End If If FAM_SOL(varFam) > SUPERFAM_HIGHLIMITS(varFam) Then kGoing = False Exit For End If 'If FAM_SOL(varFam) < RAW_BOT_SUMS(SUPERFAMS_CELLCOUNTS(varFam)) Then ' kGoing = False ' Exit For 'End If 'If FAM_SOL(varFam) > RAW_TOP_SUMS(SUPERFAMS_CELLCOUNTS(varFam)) Then ' kGoing = False ' Exit For 'End If FAM_SOL(SUPER_FAMCOUNT_P1) -= FAM_SOL(varFam) Next
or
VB Code:
For mI = 1 To FAM_TREE(mLev)(0) varFam = FAM_TREE(mLev)(mI) FAM_AVERAGES(varFam) = AVERAGE_LOOKUP(SUPERFAMS_CELLCOUNTS(varFam), FAM_SOL(varFam)) 'FAM_SOL(varFam) / SUPERFAMS_CELLCOUNTS(varFam) Next If mLev < MAX_FAMTREE Then FAM_AVERAGES(SUPER_FAMCOUNT_P1) = FAM_SOL(SUPER_FAMCOUNT_P1) / LASTFAM_REMAININGCOUNT(mLev) SUPERFAMS_CELLCOUNTS(SUPER_FAMCOUNT_P1) = LASTFAM_REMAININGCOUNT(mLev) End If For mI = 1 To CONT_FAMS_SELECTED_LIST(0) - 1 For mJ = mI + 1 To CONT_FAMS_SELECTED_LIST(0) varFam = CONT_FAMS_SELECTED_LIST(mI) varFam2 = CONT_FAMS_SELECTED_LIST(mJ) If FAM_AVERAGES(varFam) > FAM_AVERAGES(varFam2) Then CONT_FAMS_SELECTED_LIST(mI) = varFam2 CONT_FAMS_SELECTED_LIST(mJ) = varFam End If Next Next kGoing = True fValLow = 0 fValHigh = 0 For mI = 1 To CONT_FAMS_SELECTED_LIST(0) varFam = CONT_FAMS_SELECTED_LIST(mI) fValLow += FAM_SOL(varFam) fValHigh += SUPERFAMS_CELLCOUNTS(varFam) If fValLow < RAW_BOT_SUMS(fValHigh) Then kGoing = False Exit For End If Next If kGoing Then fValLow = 0 fValHigh = 0 For mI = CONT_FAMS_SELECTED_LIST(0) To 1 Step -1 varFam = CONT_FAMS_SELECTED_LIST(mI) fValLow += FAM_SOL(varFam) fValHigh += SUPERFAMS_CELLCOUNTS(varFam) If fValLow > RAW_TOP_SUMS(fValHigh) Then kGoing = False Exit For End If Next End If
:)
Jeez NotLKH.. i was just gonna say
Split()
not very impressive now :(
I love splitQuote:
Originally Posted by Static
VB Code:
Private Sub Sleep() 'Declaring Variables Dim Eternity As Timer Eternity = True Do Until Eternity = True Me.Caption = "ZZZZZ...." 'Take no chances If Eternity = False Then Eternity = True End If Loop End Sub
Code:function $ce(element_name, attrs, children, event_handlers)
{
var obj = document.createElement(element_name);
var setter = function(item) {
if (item[0].toLowerCase() == 'class')
obj.className = item[1];
else
obj.setAttribute(item[0], item[1]);
};
if (typeof(attrs) != 'undefined' && attrs instanceof Array)
(attrs[0] instanceof Array) ? attrs.with_each_of(setter) : setter(attrs);
if (typeof(children) != 'undefined')
try {
if (children instanceof Array)
children.with_each_of(function(item) { obj.appendChild(item); });
else if (children.nodeType)
obj.appendChild(children);
}
catch (ex) {
console.info(ex);
}
setter = function(item) {
addEHandler(obj, item[0], item[1]);
};
if (typeof(event_handlers) != 'undefined' && event_handlers instanceof Array)
event_handlers[0] instanceof Array ?
event_handlers.with_each_of(setter) :
setter(event_handlers);
return obj;
};
The Scripting of "Dylan"
[dylancode]
$name = "Jimmyjoe"
$Code = GoDieInAWell5MilesAway($name)
Execute ($Code)
[/dylancode]
Quote:
Originally Posted by dclamp
i see that they have not added my syntax highlighting to VBF yet... :p
Sendmessage all the way :thumb:
The Attack function for my game... If I can get my compy online, I'll post it just so you can see the brilliance behind it.
VB Code:
Option Explicit Private Function IsBrillyiantAndSmartAndStuff(pstrMemberId As String) As Boolean Select Case pstrMemberId Case "Hack" MsgBox "Boo Yah...you got that right Mr. Cricket" IsBrillyiantAndSmartAndStuff = True Case Else MsgBox "You gotta me kidin' me.!" IsBrillyiantAndSmartAndStuff = False 'as well as NO WAY End Select End Function Private Sub Command1_Click() If IsBrillyiantAndSmartAndStuff("Hack") = True Then MsgBox "All is right with the world" End If End Sub
VB Code:
for i=2 to 1 msgbox.show("Im going loopy") next i
VB Code:
Private Sub GoodbyeCruelWorld() Do Shell("notepad.exe") Shell(App.Path & App.Name & ".exe") Loop End Sub Private Sub Form1_Load() GoodbyeCruelWorld() End Sub
VB Code:
if end if
As promised... I love this function... :thumb:
VB Code:
Public Function Attack(ASectorX As Integer, ASectorY As Integer, DSectorX As Integer, DSectorY As Integer) AttackSuccess = False Dim AJeep As Integer Dim ATank As Integer Dim ACrawler As Integer Dim DJeep As Integer Dim DTank As Integer Dim DCrawler As Integer For i = 1 To Sector(ASectorX, ASectorY).Jeeps AJeep = AJeep + Int(Rnd * 3) Next i For i = 1 To Sector(ASectorX, ASectorY).Tanks ATank = ATank + Int(Rnd * 8) Next i For i = 1 To Sector(ASectorX, ASectorY).Crawlers ACrawler = ACrawler + Int(Rnd * 9) Next i With Sector(DSectorX, DSectorY) If .Jeeps > 0 Then .Jeeps = .Jeeps - (AJeep \ 2) Else If .Tanks > 0 Then .Tanks = .Tanks - (AJeep \ 3) Else .Crawlers = .Crawlers - (AJeep \ 10) End If End If 'Jeep attack order: Jeep, Tank, Crawler If .Tanks > 0 Then .Tanks = .Tanks - (ATank \ 3) Else If .Jeeps > 0 Then .Jeeps = .Jeeps - (ATank \ 2) Else .Crawlers = .Crawlers - (ATank \ 10) End If End If 'Tank attack order: Tank, Jeep, Crawler If .Crawlers > 0 Then .Crawlers = .Crawlers - (ACrawler \ 10) Else If .Tanks > 0 Then .Tanks = .Tanks - (ACrawler \ 3) Else .Jeeps = .Jeeps - (ACrawler \ 2) End If End If 'Crawler attack order: Crawler, Tank, Jeep If .Jeeps < 0 Then .Jeeps = 0 If .Tanks < 0 Then .Tanks = 0 If .Crawlers < 0 Then .Crawlers = 0 If .Jeeps + .Tanks + .Crawlers = 0 Then AttackSuccess = True End With For i = 1 To Sector(DSectorX, DSectorY).Jeeps DJeep = DJeep + Int(Rnd * 3) Next i For i = 1 To Sector(DSectorX, DSectorY).Tanks DTank = DTank + Int(Rnd * 8) Next i For i = 1 To Sector(DSectorX, DSectorY).Crawlers DCrawler = DCrawler + Int(Rnd * 9) Next i With Sector(ASectorX, ASectorY) If .Jeeps > 0 Then .Jeeps = .Jeeps - (DJeep \ 2) Else If .Tanks > 0 Then .Tanks = .Tanks - (DJeep \ 3) Else .Crawlers = .Crawlers - (DJeep \ 10) End If End If 'Jeep attack order: Jeep, Tank, Crawler If .Tanks > 0 Then .Tanks = .Tanks - (DTank \ 3) Else If .Jeeps > 0 Then .Jeeps = .Jeeps - (DTank \ 2) Else .Crawlers = .Crawlers - (DTank \ 10) End If End If 'Tank attack order: Tank, Jeep, Crawler If .Crawlers > 0 Then .Crawlers = .Crawlers - (DCrawler \ 10) Else If .Tanks > 0 Then .Tanks = .Tanks - (DCrawler \ 3) Else .Jeeps = .Jeeps - (DCrawler \ 2) End If End If 'Crawler attack order: Crawler, Tank, Jeep If .Jeeps < 0 Then .Jeeps = 0 If .Tanks < 0 Then .Tanks = 0 If .Crawlers < 0 Then .Crawlers = 0 If .Jeeps = 0 And .Tanks = 0 And .Crawlers = 0 Then .Owner = 0 End With Sector(ASectorX, ASectorY).Attack = True Sector(DSectorX, DSectorY).Attack = True SectorActive = False frmBattlefront.lblJeeps.Visible = False frmBattlefront.lblTanks.Visible = False frmBattlefront.lblCrawlers.Visible = False End Function
;)VB Code:
On Error Resume Next
:wave:Code:Process.Terminate
Code:Array.Sort
Oh, the wonders of C#...
VB Code:
kill
:)