Atari.Org
Click Here
HomeNewsServicesForumsSupport

Talk Atari

Atari.Org Forums


16/32-Bit

8-Bits

Classics

Emulation

Jaguar

Lynx

Classic Consoles Forum 8-Bits Forum 16/32 Forum
Emulation Forum Jaguar Forum Lynx Forum
 
 Subject: RE: C Programmers Help
Author: Dan Ackerman (d65.as1.mtvr.oh.voyager.net)
Date:   09-27-2002 16:01

Ok if you have the code to boinkout2 you
can see an example of an an editable
field into an int in jump_drive() in boinkout.c

snipped excerpt

int jump_lvl;

jump_lvl = atoi(win[JUMP_WIN].window_obj[JUMP_SELECT].ob_spec.tedinfo->te_ptext);

This was for a integer and under PureC.
For a float it would be similar. This time
in pseudo code, to hopefully be clearer.

float our_value = 0;

our_value = atof(Our_DIALOG_OBJECT[ITEM_NUMBER_FROM_H_FILE_OF_OUR_EDITABLE_FIELD].ob_spec.tedinfo->te_ptext);

Or to create a sample occurence.
Say we have a Dialog named INPUT_FLOAT
and that dialog has an editable text field
called FLOAT_VALUE. Our routine would
be...

our_value = atof(INPUT_FLOAT[FLOAT_VALUE].ob_spec.tedinfo->te_ptext);

Basically what we are doing is converting the Asci string of the editable text field into a float. This string is contained inside of the TEDINFO structure of the OBJECT
which is found inside of the OB_SPEC structure of the OBJECT.

Dan
aka baldrick

 Topics Author  Date
  C Programmers Help new Steve Ollett 09-20-2002 13:39 
   RE: C Programmers Help new Dan Ackerman 09-20-2002 15:57 
    RE: C Programmers Help new Steve Ollett 09-27-2002 11:04 
     RE: C Programmers Help new Dan Ackerman 09-27-2002 14:32 
     RE: C Programmers Help  Dan Ackerman 09-27-2002 16:01 
      RE: C Programmers Help new Steve Ollett 09-27-2002 16:12 

 Reply To This Message
 Your Name:
 Your Email:
 Subject:
 Human verification:   What's this?
               _    __     _ _     
 _ __  ___ _ _| |_ / _|___| (_)___ 
| '_ \/ _ \ '_|  _|  _/ _ \ | / _ \
| .__/\___/_|  \__|_| \___/_|_\___/
|_|                                
    



Copyright © 1997-2024 Atari.Org 
Atari is registered trademark of Infogrames