Computer Science Canada Records |
Author: | rk_rkade [ Mon Apr 12, 2004 6:31 pm ] |
Post subject: | Records |
hey guys.... umm im kinda embaressed to say this but i'm a newb, and i have no dam clue on how to make and edit a record.... i read dodge_tomahawk's tutorial, but i ran it and it didn't ask me to input anything .... i want to be able to input names, addresses, telephone #s, etc. so i kinda need help desperately .... i'd appriciate it if anyone can explain it to me.... thanks |
Author: | Tony [ Mon Apr 12, 2004 7:00 pm ] | ||
Post subject: | |||
well records are used to group a number of variables into a group to create types. Such as a 2D point type will contain both X and Y coordinates of the point rether then having 2 separate variables.
here instead having to declear separate variables for name and age, a record is created to hold both. A variable is decleared to be of that type and contains every variable field inside of itself. records are usually used in conjunction with arrays |
Author: | EDEN-E [ Mon Apr 12, 2004 10:37 pm ] | ||
Post subject: | or | ||
or you can declare variable like following without 'type'
|
Author: | rk_rkade [ Thu Apr 15, 2004 5:52 pm ] |
Post subject: | |
YAY! thanks a lot guys.....but, how can i type the name/age as a variable instead of a constant? and also, how can i save it in a text file?? thanx again guys.... |
Author: | AsianSensation [ Thu Apr 15, 2004 6:30 pm ] | ||
Post subject: | |||
like you would save any other string.
to get, just get it in the same fashion as normal textfiles. But make sure you get it in the same format when you declared the structure. |
Author: | rk_rkade [ Sun Apr 18, 2004 1:06 pm ] |
Post subject: | |
aah....thanks a lot AsianSensation....you answered everything that i wanted to kno.... ! |
Author: | the_short1 [ Sun Apr 18, 2004 4:43 pm ] |
Post subject: | |
that was a question from the gr.10 turing book.. "make a program using record's that asks the user for age,name,adress, then display it" sound familiar.... its ok RK_RK..... ur better then most ppl that come here for help.... some just say the question from the book and tell us to do it.. u were genuinely needing the help, and u were atempting it.... good job... ur not 'one of them' **the anoying ppl that just ask us for the answers.... here is 3 bits... and i hope u become an active member of this forum |
Author: | rk_rkade [ Wed Apr 21, 2004 5:54 pm ] |
Post subject: | |
YAY! thanks short1 ...i'll try to b as active as i can 8) |
Author: | gamer [ Wed Apr 21, 2004 5:58 pm ] |
Post subject: | |
sry but little confusing for me.....but i will still try it...thnx forhelp |
Author: | TheZsterBunny [ Sun Apr 25, 2004 3:16 pm ] |
Post subject: | |
how can one read entire records from a file? and for that matter, write them. and is it possible to have arrays within the records? -bunny (read/write not get/put) |
Author: | Cervantes [ Sun Apr 25, 2004 4:14 pm ] | ||
Post subject: | |||
yeah you can have arrays within the records. you just do it.
EDIT: One thing you can't do to the best of my knowledge in the current version of turing is use flexible arrays in records. You get a syntax error. |
Author: | the_short1 [ Sun Apr 25, 2004 6:23 pm ] |
Post subject: | |
yea... records are great for mass amounts of stuff... see their use in Asian Sensation's and Mazer's SNOWFALL program in source code.. cuz it needed x,y, and direction, and size.... and it works VERY well.. .... now i want to make something as good as that snowfall.. ?: WHAT IS A FLEXIBLE ARRAY?? |
Author: | TheZsterBunny [ Sun Apr 25, 2004 6:43 pm ] | ||
Post subject: | |||
a flexible array is an array which must be 1d, but can change size. ex.
flexon is now an array from 1..50 this can be used in animation where you don't always have to have so many, but the number can change. -bunny oh, and flexon(r) is wholly owned by someone, so i can't use the name. [/code] |
Author: | TheZsterBunny [ Sun Apr 25, 2004 7:15 pm ] |
Post subject: | |
The problem i'm having with records are writing them to files. I'll attach my problem. this is supposed to help design levels for my game. it is still in the process of being made (the code is disorderly, and the program sucks) but i cannot seem to get this program to write full records. my record has an array, a string, and an integer. all 3 are initialized, but only the string is put. Why is this |