Beiträge von jpolzfuss

    Ich habe gerade einmal https://www.codeconvert.ai/app benutzt, um mainAddressCtrl.asm nach C konvertieren zu lassen. Keine Ahnung, ob das wirklich fehlerfrei ist, aber ein wenig beeindruckend ist das schon, oder?


    /*
    (c) Copyright Geoworks 1996 -- All Rights Reserved
    GEOWORKS CONFIDENTIAL
    PROJECT: PC GEOS
    MODULE: Calendar/Main
    FILE: mainAddressCtrl.asm
    AUTHOR: Jason Ho, Dec 21, 1996
    */

    #include <stdio.h>

    // Function prototypes
    int CalendarAddressCtrlGetSelectedSMSNum();
    int CalendarAddressCtrlGetBookId();
    void CalendarAddressCtrlSetBookId(int bookId);
    void CalendarAddressCtrlContactSelected();
    void CalendarAddressCtrlMultipleContactsSelected();
    void CalendarAddressCtrlMultipleRecentNumberSelected();
    void CloseContactListShowSummary();
    void GetNumberAndNameFromContdb();
    void CalendarAddressCtrlRecentNumberSelected();
    void CalendarAddressCtrlManualDialing();
    int HandleManualNumberCommon();
    int CalendarAddressCtrlGetMiscFlags();
    void CalendarAddressCtrlCopySentToInfo();
    void CalendarAddressCtrlFetchRecipientInfo();
    void CalendarAddressCtrlFreeSelectionBlocks();

    // Constants
    #define MAX_NUMBER_FIELD_DATA_LEN 100
    #define MAX_NAME_DATA_LEN 100

    // Data structures
    typedef struct {
    char selectedSMSNum[MAX_NUMBER_FIELD_DATA_LEN+1];
    char selectedName[MAX_NAME_DATA_LEN+1];
    char recipientPasswd[MAX_NAME_DATA_LEN+1];
    int bookID;
    int miscFlags;
    int selectedContactsHandle;
    int recentContactsHandle;
    int numOfSelection;
    } CalendarAddressCtrlClass;

    // Function implementations
    int CalendarAddressCtrlGetSelectedSMSNum() {
    // Get the SMS number of selected contact
    // The buffer should be at least MAX_NUMBER_FIELD_DATA_LEN+1 / MAX_NAME_DATA_LEN+1 chars big
    CalendarAddressCtrlClass *object;
    int message;
    char *buffer;
    int length;
       
    // Get source
    if (message == MSG_CALENDAR_ADDRESS_CTRL_GET_SELECTED_SMS_NUM) {
    buffer = object->selectedSMSNum;
    } else if (message == MSG_CALENDAR_ADDRESS_CTRL_GET_SELECTED_NAME) {
    buffer = object->selectedName;
    } else if (message == MSG_CALENDAR_ADDRESS_CTRL_GET_RECIPIENT_PASSWD) {
    buffer = object->recipientPasswd;
    }
       
    // Copy string
    length = strlen(buffer);
       
    return length;
    }

    int CalendarAddressCtrlGetBookId() {
    // Get the book ID of the current booking for the particular event
    CalendarAddressCtrlClass *object;
       
    return object->bookID;
    }

    void CalendarAddressCtrlSetBookId(int bookId) {
    // Set the book ID of the current booking for the particular event
    CalendarAddressCtrlClass *object;
       
    object->bookID = bookId;
    }

    void CalendarAddressCtrlContactSelected() {
    // User pressed the "select" trigger in the address control
    // Get ready to send our message
    CalendarAddressCtrlClass *object;
       
    // We surely have matching contact
    object->miscFlags &= ~(1 << CACF_HAS_MATCHING_CONTACT);
       
    // Get number and name from contdb, and store into instance data
    GetNumberAndNameFromContdb();
       
    // Close the contact window and show the summary window
    CloseContactListShowSummary();
    }

    void CalendarAddressCtrlMultipleContactsSelected() {
    // User pressed the "select" trigger in the address control, and we are doing multiple selection
    // Get ready to send our message
    CalendarAddressCtrlClass *object;
    int handle;
    int numOfSelection;
       
    // We surely have matching contact
    object->miscFlags &= ~(1 << CACF_HAS_MATCHING_CONTACT);
       
    // Remember all the passed parameters in instance data
    object->selectedContactsHandle = handle;
    object->numOfSelection = numOfSelection;
       
    // We don't have recent contacts
    object->recentContactsHandle = 0;
       
    // If just one selection, clear the flag CACF_MULTIPLE_RECIPIENTS; else set the flag
    if (numOfSelection == 1) {
    object->miscFlags &= ~(1 << CACF_MULTIPLE_RECIPIENTS);
    } else {
    object->miscFlags |= (1 << CACF_MULTIPLE_RECIPIENTS);
    }
       
    // Close the contact window and show the summary window
    CloseContactListShowSummary();
    }

    void CalendarAddressCtrlMultipleRecentNumberSelected() {
    // Sent when the user has selected a "recent sms number" from the "recent contact" control, only this time the user selects multiple numbers
    CalendarAddressCtrlClass *object;
    int handle;
    int numOfSelection;
       
    // Remember all the passed parameters in instance data
    object->recentContactsHandle = handle;
    object->numOfSelection = numOfSelection;
       
    // We don't have regular contacts selected
    object->selectedContactsHandle = 0;
       
    // If just one selection, clear the flag CACF_MULTIPLE_RECIPIENTS
    if (numOfSelection == 1) {
    object->miscFlags &= ~(1 << CACF_MULTIPLE_RECIPIENTS);
    } else {
    object->miscFlags |= (1 << CACF_MULTIPLE_RECIPIENTS);
    }
       
    // Give a warning if we are doing reservation
    if (GetBookEventType() == BET_NORMAL_EVENT) {
    printf("Multiple recent numbers reservation warning\n");
    }
       
    // Clear the password text
    memset(object->recipientPasswd, 0, sizeof(object->recipientPasswd));
       
    // Close the contact window and show the summary window
    CloseContactListShowSummary();
    }

    void CloseContactListShowSummary() {
    // Close the contact list, and show the summary of SMS event
    printf("Close contact list and show summary\n");
    }

    void GetNumberAndNameFromContdb() {
    // Fetch the SMS number and name of a contact from the contdb
    CalendarAddressCtrlClass *object;
    int recordID;
    int fieldID;
       
    // Fetch the SMS number from contdb
    // Get record handle
    int dbHandle = ContactGetDBHandle();
    int blockHandle = FoamDBGetRecordFromID(dbHandle, recordID);
       
    // Dereference, and get field data
    char buffer[MAX_NUMBER_FIELD_DATA_LEN+1];
    FoamDBGetFieldData(blockHandle, fieldID, buffer, sizeof(buffer));
       
    // Null terminate the data string
    buffer[strlen(buffer)] = '\0';
       
    // Get the password field
    char password[MAX_NAME_DATA_LEN+1];
    FoamDBGetFieldData(blockHandle, CFT_PASSWORD, password, sizeof(password));
       
    // Null terminate the data string
    password[strlen(password)] = '\0';
       
    // Get the name field
    char name[MAX_NAME_DATA_LEN+1];
    ContactGetName(blockHandle, name);
       
    // Discard the record handle, now that we are done
    FoamDBDiscardRecord(blockHandle);
       
    // Release the database handle
    ContactReleaseDBHandle(dbHandle);
       
    // Store the fetched data into instance data
    strcpy(object->selectedSMSNum, buffer);
    strcpy(object->recipientPasswd, password);
    strcpy(object->selectedName, name);
    }

    void CalendarAddressCtrlRecentNumberSelected() {
    // Sent when the user has selected a "recent sms number" from the "recent contact" control
    CalendarAddressCtrlClass *object;
    char *recentNumber;
       
    // Consider the "recent number" as manual entered number, because there is no guarantee that the contact it specifies (RCD_contactID) exists anyway
    strcpy(object->selectedSMSNum, recentNumber);
       
    // Handle manual number
    HandleManualNumberCommon();
    }

    void CalendarAddressCtrlManualDialing() {
    // Received when the user presses the "manual dialing" trigger
    CalendarAddressCtrlClass *object;
       
    // User enters the manual dial number, and presses OK
    // Handle manual number
    HandleManualNumberCommon();
    }

    int HandleManualNumberCommon() {
    // Now that we have the manual / recent number in instance data, do name matching, fetch password if contact is found, etc.
    CalendarAddressCtrlClass *object;
       
    // Do name matching, fetch password if contact is found, etc.
    printf("Handle manual/recent number common\n");
       
    return 0;
    }

    int CalendarAddressCtrlGetMiscFlags() {
    // Get the CACI_miscFlags
    CalendarAddressCtrlClass *object;
       
    return object->miscFlags;
    }

    void CalendarAddressCtrlCopySentToInfo() {
    // From instance data, copy info to EventSentToStruct
    printf("Copy info to EventSentToStruct\n");
    }

    void CalendarAddressCtrlFetchRecipientInfo() {
    // Fetch the recipient info from contdb
    printf("Fetch recipient info from contdb\n");
    }

    void CalendarAddressCtrlFreeSelectionBlocks() {
    // Free the multiple selection mem blocks in instance
    printf("Free multiple selection mem blocks\n");
    }

    int main() {
    // Test the translation of the code
    return 0;
    }

    Es gibt mehrere Schleifen, die von 0 bis 6 laufen. Und das ist leider von Sonntag bis Samstag. Diese Schleifen müsste man auf „1-6 und dann hinterher alles nochmal für die 0“ umstellen. Möglich wäre es, aber aufwändig. Die Stellen, die ich bislang gesehen habe, habe ich nur gefunden, weil es im Quelltext entsprechende Kommentare gab.

    Wenn der Kalender einfach nur tageweise Termine anzeigen soll, könnte man sich auch mit „CSV-Datei pro Tag“ retten (20240229.CSV, 20240301.CSV, …).

    Wenn die Applikation dann jedoch eine Suche nach allen Zahnarztterminen der letzten fünf Jahre und/oder eine „Autovervollständigung“ (Übernahme von Details aus alten Terminen) anbieten soll, dann wird die CSV-Ablage schnell seeeeeehr laaaaaangsam.

    Und wenn dann die Applikation noch Adressen aus dem Adressbuch übernehmen soll, dann stößt man mit R-Basic vermutlich an die Grenzen. (à la „Ich gebe <<Montag, 15 Uhr Zahnarzt>> ein und der Kalender übernimmt dann automatisch die Adresse der Praxis aus dem Adressbuch in die Termindetails.“)

    At least I wouldn’t change the order in that enum as this might ruin other programs and as Sunday=0 is the standard in other programming languages as well:

    DayOfWeek Enum (System)
    Specifies the day of the week.
    learn.microsoft.com
    C++ || How To Get The Day Of The Week & The Week Day Name From A Date Using C++
    {{CODE_Includes}} The following is a module with functions which demonstrates how to get the day of the week and the week day name from a given date using C++.…
    www.programmingnotes.org

    (Yes, there are also programming languages where Sunday=7, e.g.

    https://docs.oracle.com/javase/8/docs/…eek.html#SUNDAY )

    Hallo!

    Der richtige Name wäre „Vier gewinnt“. Ich weiß nur nicht, ob der markenrechtlich geschützt ist:
    https://de.wikipedia.org/wiki/Vier_gewinnt

    Sicherheitshalber dann vielleicht „Vierer Reihe“?

    „Crossword Maker“ würde ich eher mit „Kreuzworträtsel Ersteller“ (oder Erzeuger?) übersetzen. „Macher“ klingt für mich eher so, als würde das Programm für mich ein Rätsel lösen… . Ist aber Geschmacksache.

    Columns zu übersetzen, wäre mir zu schräg… Säulen? Kolonnaden? Spalten? Kolonnen? Pfeiler? Stützen? Reihen? Stäbe? Säulerei? …? Man könnte es noch so nennen, wenn man das ein wenig regional anhauchen wollen würde:

    • Ditt krasse Spiel mit den konkreten Säulen, ey!
    • Dat Speel mit de Sülen
    • Sülen-Speel
    • Das Spiel wo mit den Säulen ist
    • Saupreußische Säulen

    :D:S8o

    Ich bin zwar nicht dafür, aber...

    Gibt es denn keine Möglichkeit geben, das im Programm-Code zu ändern? :/

    Mir wäre es auch lieber, die Bugs in der DosBox bzgl. Umlauten etc. in Datei-/Ordnernamen zu beheben, statt hier irgendwelche Notlösungen zu etablieren. Zur Not könnte man auch den Geos-FS-Treiber so ändern, dass er nie versucht, Umlaute etc. in den DOS-Namen zu schreiben, sondern immer nur in den Geos-Namen, bzw. in die dirname-Datei.

    Ja, es klingt so, als müsse man etwas tun, wenn man das PCMCIA-Zeugs nutzen wollen würde. Aber aktuell ist es ja gar nicht inkludiert, was dann bestenfalls noch GeoBook-Nutzern oder Nutzern von steinalten Laptops auffallen würde. Zudem müssten auch unter DOS die entsprechenden DOS-Treiber installiert sein. Das dürfte etwas schwierig werden, da es die DOS-CardServices-Software bestenfalls als Abandonware gibt.