Select string from a list/array based on retrieved integer

Man … either my Google-Fu is weak today, or this is just one of those questions that can’t be worded in a way that yields useful search results.

I’m retrieving a numeric value that translates to one of a number of strings (for example: 1 = blue, 2 = red, 3 = yellow). Is there a way I can return the string based on the number retrieved? Sort of like a SELECT CASE statement in other languages?

Thanks!

1 Like

Yes, but it is not obvious. What is your use case?

See here: Identifying RAM type on Windows

( tuple string item ( 24 ) of "Unknown, Other, Unknown, DRAM, EDRAM, VRAM, SRAM, RAM, ROM, FLASH, EEPROM, FEPROM, EPROM, CDRAM, 3DRAM, SDRAM, SGRAM, RDRAM, DDR, DDR2, DDR2 FB-DIMM, Reserved, Reserved, Reserved, DDR3, FBD2, DDR4, LPDDR, LPDDR2, LPDDR3, LPDDR4" )

I have many examples using the SMBIOS inspector & the WMI inspector that do this.

Examples:

It’s WMI stuff. Thanks!

1 Like

I’d definitely recommend checking BigFix.Me for similar WMI stuff because it is likely that something similar is already there.

Put the following into google to find example WMI for DCIM_Battery

inurl:bigfix.me wmi "from DCIM_Battery"

You can do similar for other WMI queries.

1 Like

Hi All,

I have concern about getting DIMM Slot information.

For ex:- My system is having four DIMM slot in below fashion
Bank A Bank B
DIMM slot 0 - 4 GB DIMM slot 0 - 4 GB
DIMM slot 1 - 4 GB DIMM slot 1 - 4 GB
DIMM slot 2 - 8 GB DIMM slot 2 - 8 GB
DIMM slot 3 - empty DIMM slot 3 - empty

Is there any way to gather this output using relevance

Need guidance.Thanks in advance

@jgstew and I are the only ones who will likely see this comment since you added it to a six-month old post that has nothing to do with your comment. I strongly recommend creating a new post with your question so that others might see it and respond.

1 Like

Sure…I will do that