Page 1 of 1

xbaseAI

Posted: Mon Jul 17, 2023 6:25 am
by rdonnay
Certainly! Here's a simplified example of an office management program written in xBase language:

```
PROCEDURE OfficeManagement
CLEAR

DO WHILE .T.
? "Welcome to the Office Management program."
? "What would you like to do?"
? "1. Add a new employee"
? "2. View employee details"
? "3. Update employee details"
? "4. Delete employee"
? "5. Exit"

? "Enter your choice (1-5): "
nChoice = VAL(INPUT(1))

IF nChoice = 1
AddEmployee()
ELSEIF nChoice = 2
ViewEmployeeDetails()
ELSEIF nChoice = 3
UpdateEmployeeDetails()
ELSEIF nChoice = 4
DeleteEmployee()
ELSEIF nChoice = 5
? "Exiting the program..."
EXIT
ELSE
? "Invalid choice. Please try again."
ENDIF
ENDDO
RETURN

PROCEDURE AddEmployee
? "Enter employee details:"
? "Name: "
cName = INPUT(50) && Assuming maximum length of 50 characters
? "Age: "
nAge = VAL(INPUT(3)) && Assuming maximum age of 999
? "Department: "
cDepartment = INPUT(20) && Assuming maximum length of 20 characters

APPEND BLANK
REPLACE Name WITH cName, Age WITH nAge, Department WITH cDepartment
? "Employee added successfully."
RETURN

PROCEDURE ViewEmployeeDetails
? "Enter the employee name to view details: "
cSearchName = INPUT(50) && Assuming maximum length of 50 characters

LOCATE FOR Name = cSearchName
IF FOUND()
? "Employee details:"
? "Name: " + Name
? "Age: " + TRANSFORM(Age)
? "Department: " + Department
ELSE
? "Employee not found."
ENDIF
RETURN

PROCEDURE UpdateEmployeeDetails
? "Enter the employee name to update details: "
cSearchName = INPUT(50) && Assuming maximum length of 50 characters

LOCATE FOR Name = cSearchName
IF FOUND()
? "Enter updated employee details:"
? "Name: "
cName = INPUT(50)
? "Age: "
nAge = VAL(INPUT(3))
? "Department: "
cDepartment = INPUT(20)

REPLACE Name WITH cName, Age WITH nAge, Department WITH cDepartment
? "Employee details updated successfully."
ELSE
? "Employee not found."
ENDIF
RETURN

PROCEDURE DeleteEmployee
? "Enter the employee name to delete: "
cSearchName = INPUT(50) && Assuming maximum length of 50 characters

LOCATE FOR Name = cSearchName
IF FOUND()
DELETE
? "Employee deleted successfully."
ELSE
? "Employee not found."
ENDIF
RETURN

OfficeManagement()
```

This program allows the user to manage employees by adding, viewing, updating, and deleting their details. It keeps running until the user selects the exit option.

Is there anything specific you would like to discuss further or any other assistance you need?

Answered by Free Powerful Ask ChatAI 👉👉👉 https://play.google.com/store/apps/deta ... ly.browser

Re: xbaseAI

Posted: Mon Jul 17, 2023 11:40 pm
by SbDrakos
Roger,

So I don't understand, am I being replaced?
Are you saying I need to find a job at Walmart?

Please advise.
Sincerely fading into the background.... :techie-hiding:

Bobby

Re: xbaseAI

Posted: Tue Jul 18, 2023 5:48 am
by rdonnay
AI is being touted as a new paradigm which will replace us all.

I guess it's a reminder of the Russian revolution where they talked about 2 steps forward, 1 step back.

This program takes us back to 1981, the birth of dBase-II, the most primitive of the xBase languages. xbaseAI has a long way to go to catch up.