SetField.c 703 B

123456789101112131415161718192021222324252627
  1. // *************************************************************************
  2. // SetField.c
  3. //
  4. // Modifications:
  5. // mm/dd/yy - description - author
  6. // *************************************************************************
  7. #include "external.h"
  8. Handle SetField( FormPtr frm, int Nr, char* Value, int Size, Boolean Focus )
  9. {
  10. Word objIndex;
  11. CharPtr AmountP;
  12. Handle AmountH;
  13. objIndex = FrmGetObjectIndex( frm, Nr );
  14. AmountH = MemHandleNew( Size );
  15. AmountP = MemHandleLock( AmountH );
  16. StrCopy( AmountP, Value );
  17. MemPtrUnlock( AmountP );
  18. FldSetTextHandle( FrmGetObjectPtr( frm, objIndex ), AmountH );
  19. if (Focus)
  20. FrmSetFocus( frm, objIndex );
  21. return AmountH;
  22. }