function Main()
local oWnd := TWindow():New()
local cpath:= apppath()
local cDbf:= cpath+"/test.dbf"
local cAlias
oWnd:Activate()
MsgInfo( "Hello world! "+cDbf )
use (cDbf) New
calias:=alias()
Msginfo(calias)
dbgoto(5)
msginfo( (calias)->last )
dbskip(5)
msginfo( (calias)->last )
close(calias)
http://www.ikangai.com/blog/development/code-snippet-of-the-week-modal-uialertview-update
@interface MyUIAlertViewDelegate : NSObject <UIActionSheetDelegate, UIAlertViewDelegate>
{
int result;
}
-(int)getResult;
@end;
@implementation MyUIAlertViewDelegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
result = buttonIndex;
}
-(int)getResult
{
return result;
}
@end;
void MimsSleep(uint32_t msec)
{
struct timespec timeout0;
struct timespec timeout1;
struct timespec* tmp;
struct timespec* t0 = &timeout0;
struct timespec* t1 = &timeout1;
t0->tv_sec = msec / 1000;
t0->tv_nsec = (msec % 1000) * (1000 * 1000);
while ((nanosleep(t0, t1) == (-1)) && (errno == EINTR))
{
tmp = t0;
t0 = t1;
t1 = tmp;
}
}
HB_FUNC( MSGBEEP )
{
// NSBeep();
}
void MsgInfo( NSString * text )
{
MyUIAlertViewDelegate *lpDelegate = [[MyUIAlertViewDelegate alloc] init];
UIAlertView * alert = [ [ UIAlertView alloc ] initWithTitle : @"Information"
message : text delegate : lpDelegate
cancelButtonTitle : @"OK" otherButtonTitles : nil ];
[ alert show ];
// Run modally!
// By the time this loop terminates, our delegate will have been called and we can
// get the result from the delegate (i.e. what button was pressed...)
while ((!alert.hidden) && (alert.superview!=nil))
{
[[NSRunLoop currentRunLoop] limitDateForMode:NSDefaultRunLoopMode];
Mimssleep(10);
}
// Grab the result from our delegate (via a custom property)
int nResult = [lpDelegate getResult];
// aqui damos salida al resultado
[ alert release ];
[lpDelegate release];
}
Antonio Linares wrote:No se puede usar el emulador porque en realidad es un simulador que ejecuta código intel, no arm.
function Main()
local oWnd := TWindow():New()
TNavBar():New( oWnd, "FivePhone", "Exit", "About" )
oWnd:Activate()
return nil
#import <UIKit/UIKit.h>
#import <UIKit/UIApplication.h>
#define HB_DONT_DEFINE_BOOL
#include <hbapi.h>
HB_FUNC( APPPATH )
{
NSString * buPath = [ [ NSBundle mainBundle ] bundlePath ];
hb_retc( [ buPath cStringUsingEncoding : NSASCIIStringEncoding ] );
}
Antonio Linares wrote:Daniel,
Te digo como lo estamos usando nosotros:
una vez construido el ejecutable, copialo dentro de la aplicacion TabBarSample, renombrando tu ejecutable a TabBarSample y hazle chmod +x TabBarSample
Return to FiveMac / FivePhone (iPhone, iPad)
Users browsing this forum: No registered users and 11 guests