Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new Vfp project available on github

Status
Not open for further replies.

mplaza

Programmer
Nov 23, 2009
135
VE
Hi, I Just made available a new Visual Foxpro Project on github, called nfTools. The first component

is _ ( underscore ) - ( ) - wich allows you to construct/edit complex

objects the easy way, seeing the structure tree "as it is" in your own code.

Now creating objects that truly reflects your business / procedures needs is an easy task.

Just drop _.prg on your vfp path and you can start using the following syntax:

Code:
Public omypc && check later on your debugger

omypc = Createobject('empty')

With _( omypc )  && simply pass object you want to modify, any referenced property will be added to passed object if does not exist:

	.madeby = 'Marco Plaza, 2018 - nfTools'
	.manufacturer = 'custom'
	.baseprice = 699
	.casetype  = 'ATX'
	.modelname = 'Ryzen Performance Plus'

	With _( .cpu )   && cpu will be a new object for oMyPc - check we pass ".cpu"  ( dot cpu ) because it's inside with - endwith
		.processorcount = 6
		.brand = 'AMD'
		.model = 'Ryzen 7'
		.clockspeed = 4.3
		.processorcount = 8
	Endwith

	With _(.motherboard)

		.manufacturer = 'Asus'
		.model = 'Prime B350-Plus AMD'
		.formfactor = 'ATX'
		.cpusocket = 'AM4'

		.power = .newList('CPU','CASE1','CASE2','CASE3')  && creating a list with 4 items

		.SPECS = .newCollection()
		
		with .newItemFor('specs','memory')  && adding an item to 'specs' collection with key 'memory 
			.type = 'DDR4'
			.MAXSIZE = '64GB'
			.slots = 4
		endwith
		
		with .newItemFor('specs','usb')
			.internal = '3 @ PCIe 3.0 x2'
			.front = 'x1 Type-C'
			.rear  = 'x2 Type-A'
		endwith
		

	Endwith

	.storage = .newList()
	
	with .newItemFor( 'storage' )  && adding objects to list
		.manufacturer = 'Samsung'
		.model = '960 evo Series'
		.Type = 'internal'
		.connectivity = 'PCIe NVMe M.2'
		.capacity = '250gb'
	Endwith

	with .newItemFor( 'storage' )
		.manufacturer = 'Seagate'
		.model = 'Barracuda ST3000DM008'
		.Type = 'Internal'
		.formfactor = 3.5
		.capacity = '3tb'
		.connectivity = 'Sata 6.0'
		.rotationspeed = 7200
	Endwith


endwith

clear

? oMypc.motherboard.power[1]
? oMypc.storage[1].connectivity
? omypc.motherboard.specs('memory').maxsize
? omypc.motherboard.specs('memory').slots
? omypc.motherboard.specs('usb').front

Checking oMypc on the debugger:

_test_qhrmld.jpg


Any comments, bug reports are welcome.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top