-
-
Save WinstonN/d1fa1fb7090048c836981fae459f5435 to your computer and use it in GitHub Desktop.
Revisions
-
WinstonN revised this gist
Jan 8, 2018 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ * @param int size - size of the array (default = 1) * @return int blank array of size */ void clearIntArray( int& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); @@ -18,7 +18,7 @@ int clearIntArray( int& theArray[], int size = 0 ) { * @param int size - size of the array (default = 1) * @return int blank array of size */ void clearDoubleArray( double& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); @@ -31,7 +31,7 @@ int clearDoubleArray( double& theArray[], int size = 0 ) { * @param int size - size of the array (default = 1) * @return int blank array of size */ void clearStringArray( string& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); @@ -44,7 +44,7 @@ int clearStringArray( string& theArray[], int size = 0 ) { * @param int val - the item to be appended (no checks on val) * @return int the array with appended value */ void addToIntArray( int& theArray[], int val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); @@ -57,7 +57,7 @@ int addToIntArray( int& theArray[], int val ) { * @param double val - the item to be appended (no checks on val) * @return double the array with appended value */ void addToDoubleArray( double& theArray[], double val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); @@ -70,7 +70,7 @@ double addToDoubleArray( double& theArray[], double val ) { * @param string val - the item to be appended (no checks on val) * @return string the array with appended value */ void addToIntArray( string& theArray[], string val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); @@ -85,7 +85,7 @@ string addToIntArray( string& theArray[], string val ) { * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ void arrayIntToStr( int theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { @@ -102,7 +102,7 @@ string arrayIntToStr( int theArray[], string concatWith = "," ) { * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ void arrayDoubleToStr( double theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { @@ -119,7 +119,7 @@ string arrayDoubleToStr( double theArray[], string concatWith = "," ) { * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ void arrayStringToStr( string theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { -
currencysecrets revised this gist
Jan 11, 2013 . 1 changed file with 64 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,37 @@ /* * clearIntArray * This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1). * @param int& theArray - passing the array by reference * @param int size - size of the array (default = 1) * @return int blank array of size */ int clearIntArray( int& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); } /* * clearDoubleArray * This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1). * @param int& theArray - passing the array by reference * @param int size - size of the array (default = 1) * @return int blank array of size */ int clearDoubleArray( double& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); } /* * clearStringArray * This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1). * @param string& theArray - passing the array by reference * @param int size - size of the array (default = 1) * @return int blank array of size */ int clearStringArray( string& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); @@ -53,13 +79,47 @@ string addToIntArray( string& theArray[], string val ) { /* * arrayIntToStr * This function outputs a one-dimensional array to a string separated by concatWith variable. * @param int theArray - the array of items you seek to print * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ string arrayIntToStr( int theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { s = StringConcatenate( s, theArray[i], concatWith ); } s = StringSubstr( s, 0, StringLen(s) - StringLen( concatWith ) ); return ( s ); } /* * arrayDoubleToStr * This function outputs a one-dimensional array to a string separated by concatWith variable. * @param double theArray - the array of items you seek to print * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ string arrayDoubleToStr( double theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { s = StringConcatenate( s, theArray[i], concatWith ); } s = StringSubstr( s, 0, StringLen(s) - StringLen( concatWith ) ); return ( s ); } /* * arrayStringToStr * This function outputs a one-dimensional array to a string separated by concatWith variable. * @param string theArray - the array of items you seek to print * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ string arrayStringToStr( string theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { -
currencysecrets revised this gist
Jan 11, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ int addToIntArray( int& theArray[], int val ) { * @param double val - the item to be appended (no checks on val) * @return double the array with appended value */ double addToDoubleArray( double& theArray[], double val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); -
currencysecrets revised this gist
Jan 11, 2013 . 1 changed file with 30 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,18 +12,46 @@ int clearArray( int& theArray[], int size = 0 ) { } /* * addToIntArray * This function appends an integer value to an integer array. * @param int& theArray - passing the array by reference * @param int val - the item to be appended (no checks on val) * @return int the array with appended value */ int addToIntArray( int& theArray[], int val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); } /* * addToDoubleArray * This function appends a double value to a double array. * @param double& theArray - passing the array by reference * @param double val - the item to be appended (no checks on val) * @return double the array with appended value */ double addToIntArray( double& theArray[], double val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); } /* * addToStringArray * This function appends a string value to a string array. * @param string& theArray - passing the array by reference * @param string val - the item to be appended (no checks on val) * @return string the array with appended value */ string addToIntArray( string& theArray[], string val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); } /* * arrayToStr * This function outputs a one-dimensional array to a string separated by concatWith variable. -
currencysecrets revised this gist
Jan 11, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ int clearArray( int& theArray[], int size = 0 ) { } /* * addToIArray * This function appends an integer value to an integer array. * @param int& theArray - passing the array by reference * @param int val - the item to be appended (no checks on val) -
currencysecrets renamed this gist
Jan 8, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
currencysecrets revised this gist
Jan 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ */ int clearArray( int& theArray[], int size = 0 ) { ArrayResize( theArray, size ); if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } return( theArray ); } -
currencysecrets revised this gist
Jan 7, 2013 . 1 changed file with 21 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ /* * clearArray * This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1). * @param int& theArray - passing the array by reference * @param int size - size of the array (default = 1) * @return int blank array of size */ int clearArray( int& theArray[], int size = 0 ) { ArrayResize( theArray, size ); ArrayInitialize( theArray, 0 ); return( theArray ); } @@ -22,4 +22,21 @@ int addToArray( int& theArray[], int val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); } /* * arrayToStr * This function outputs a one-dimensional array to a string separated by concatWith variable. * @param int theArray - the array of items you seek to print * @param string concatWith - the string you wish to concatenate items with (default = ",") * @return string the array concatenated to a string */ string arrayToStr( int theArray[], string concatWith = "," ) { string s = ""; int a = ArraySize( theArray ); for( int i = 0; i < a; i++ ) { s = StringConcatenate( s, theArray[i], concatWith ); } s = StringSubstr( s, 0, StringLen(s) - StringLen( concatWith ) ); return ( s ); } -
currencysecrets created this gist
Jan 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ /* * clearArray * This function deletes all items in array (sets it to EMPTY_VALUE) and resizes array according to size (default = 1). * @param int& theArray - passing the array by reference * @param int size - size of the array (default = 1) * @return int blank array of size */ int clearArray( int& theArray[], int size = 1 ) { ArrayResize( theArray, size ); ArrayInitialize( theArray, EMPTY_VALUE ); return( theArray ); } /* * addToArray * This function appends an integer value to an integer array. * @param int& theArray - passing the array by reference * @param int val - the item to be appended (no checks on val) * @return int the array with appended value */ int addToArray( int& theArray[], int val ) { ArrayResize( theArray, ArraySize( theArray ) + 1 ); theArray[ ArraySize( theArray ) - 1 ] = val; return( theArray ); }