Helius
-
Posts
16 -
Joined
-
Last visited
Reputation Activity
-
Helius got a reaction from madknight3 in Beginners, please learn to debug your programs
Very nice, this should definitely be pinned. I only have one thing to add, there's a third debugging option. One could debug by commenting out code.
I'm quite new to this forum and I've noticed that 99% of the posts in this section are "Please help! Code doesn't work". Which of course, is okay, but I'd like to see more releases, tips, tutorials, and work in progress.
-
Helius reacted to KuroSetsuna29 in How to repeat a set string
^ That.
But here goes, this is my second time with pascal, no criticism please. I leave it to you to figure out how to ignore spaces. Possibly loop through input string and count number of non-spaces?
var input1, input2, output : string;var len1, len2, multiple, modulus, i : integer;begin input1 := 'comp'; input2 := 'hello'; output := ''; len1 := byte(input1[0]); len2 := byte(input2[0]); multiple := len2 div len1; (* integer division *) modulus := len2 mod len1; (* repeat whole word *) for i := 1 to multiple do begin output += input1; end; (* output last partial string *) output += copy(input1, 0, modulus); writeln(output);end. -
Helius reacted to Midnight in How to repeat a set string
This.
Just use your brain and math(specifically division and modulo). This is pretty simple.
-
Helius reacted to minibois in Need a Lil help with this program
//Place this in a button functionif (Number1+Number2 == Number3){ TextBox4.text = "Correct";}else{ TextBox4.text = "Incorrect";} This should help a bit
EDIT: wait, first you have to make the strings from TextBox1 and 2 into ints. Google how to do this in your program.
@Lexgium
-
Helius got a reaction from Guest in Basic C#
You need to add an "OnKeyDown" event and check which key is being pressed.
Here's an example:
//This event will be fired when a key is being pressed private void ControlName_KeyDown(object sender, KeyEventArgs e) { //If the pressed key is the 1 key, show a msgbox. if (e.KeyCode == Keys.D1) { MsgBox("Test"); } } I think you should have a look at this: http://www.dotnetperls.com/keycode